﻿'Commands are processed here. When an input is registered it is first sent through the CMD subroutine
'The CMD subroutine processes the commands, determines the MainProgram.State, and sends those commands to their
'perspective subroutine depending on what MainProgram.State the game is currently in.
'Open MainProgram.State is the most common MainProgram.State where most all commands are accessible.
'Closed MainProgram.State is usually during conversation MainProgram.dialogues where only a certain amount of commands are accessible
'Combat MainProgram.State is during combat obviously and only accepts certain commands
'Shopping MainProgram.State is another MainProgram.State which also only accepts certain commands

'This module is for all input commands, separated on February 13th, 2011 to allow easier viewability and organization of PLOS
Imports System.IO
Imports System.Net
Module InputCommands
    Public Sub CMD(ByVal Txt As String)
        'this subroutine passes all text that enters the program and first dissects it, interprets it, and finally sends it to
        'it's perspective function if applicable.
        Dim CaseSensitive As String = LTrim(RTrim(Txt))
        Txt = LCase(LTrim(RTrim((Txt))))
        Dim nputlen As Short
        nputlen = Len(Txt)
        '!gm_login avoids all MainProgram.States and can be used at anytime. it brings the game master
        'straight to the login screen
        If Txt = "!gm_gologin" Then
            CMD_gm_gologin(Txt, nputlen)
        End If
        If MainProgram.State = "LoginName" And Txt <> "" Then
            DetermineLoginName(Txt, nputlen)
        ElseIf MainProgram.State = "LoginPass" Then
            DetermineLoginPass(Txt, nputlen)
        ElseIf MainProgram.State = "LoginClass" Then
            DetermineLoginClass(Txt, nputlen)
        ElseIf MainProgram.State = "LoginRace" Then
            DetermineLoginRace(Txt, nputlen)
        ElseIf MainProgram.State = "LoginSex" Then
            DetermineLoginSex(Txt, nputlen)
        ElseIf MainProgram.State = "LoginProvince" Then
            DetermineLoginProvince(Txt, nputlen)
        ElseIf MainProgram.State = "LoginRode" Then
            DetermineLoginRode(Txt, nputlen)
        ElseIf MainProgram.State = "LoginTemple" Then
            DetermineLoginTemple(Txt, nputlen)
        ElseIf MainProgram.State = "Introduction" Then
            ProcessIntro(Txt, nputlen)
        ElseIf MainProgram.State = "Introductionp2" Then
            ProcessIntro2(Txt, nputlen)
        ElseIf MainProgram.State = "Introductionp2b" Then
            ProcessIntro3(Txt, nputlen)
        ElseIf MainProgram.State = "Introductionp3" Then
            ProcessIntro4(Txt, nputlen)
        ElseIf MainProgram.State = "Closed" And LTrim(RTrim(Txt)) <> "" Then
            ClosedStateInput(Txt, nputlen)
        ElseIf MainProgram.State = "Combat" Then
            CombatStateInput(Txt, nputlen)
        ElseIf MainProgram.State = "Shopping" Then
            ShoppingStateInput(Txt, nputlen)
        ElseIf MainProgram.State = "Open" Then
            Dim cmdvar As String = "" : Dim cmdlen As Short = 0
            For cmdlen = 1 To Len(Txt) Step 1
                If Mid(Txt, cmdlen, 1) = " " Then
                    cmdvar = Mid(Txt, 1, cmdlen - 1)
                    cmdlen = Len(cmdvar)
                    Exit For
                End If
            Next
            If Txt = Mid("look", 1, nputlen) Then
                CMD_look()
            ElseIf cmdvar = Mid("practice", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_practice(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("train", 1, nputlen) Then
                CMD_traininfo()
            ElseIf cmdvar = Mid("train", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_train(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("skin", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_skin(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("ctrain", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_ctrain(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("cpractice", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_cpractice(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("southwards", 1, nputlen) Then
                CMD_southwards(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("northwards", 1, nputlen) Then
                CMD_northwards(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("eastwards", 1, nputlen) Then
                CMD_eastwards(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("upwards", 1, nputlen) Then
                CMD_upwards(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("downwards", 1, nputlen) Then
                CMD_downwards(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("westwards", 1, nputlen) Then
                CMD_westwards(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("rest", 1, nputlen) Then
                CMD_rest(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("sleep", 1, nputlen) Then
                CMD_sleep(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("wake up", 1, nputlen) Then
                CMD_wakeup(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("stand up", 1, nputlen) Then
                CMD_standup(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("sit down", 1, nputlen) Then
                CMD_sitdown(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("proficiencies", 1, nputlen) Or Txt = Mid("proficiency", 1, nputlen) Then
                CMD_proficiencies(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("spells", 1, nputlen) Or Txt = Mid("skills", 1, nputlen) Or Txt = Mid("abilities", 1, nputlen) Then
                CMD_spells(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("weather", 1, nputlen) Then
                CMD_weather(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("say", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_say(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("osay", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_osay(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("ooc", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_ooc(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("ic", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_ic(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("look in", 1, cmdlen) And nputlen > cmdlen + 2 And InStr(Txt, " in ") Then
                CMD_lookin(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("look", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_look(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("list", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_list(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("talk", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_talk(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("kill", 1, cmdlen) And nputlen > cmdlen + 2 Then
                CMD_kill(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("inventory", 1, nputlen) Then
                CMD_inventory(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("report", 1, nputlen) Or Txt = Mid("show log", 1, nputlen) Then
                CMD_report(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("languages", 1, nputlen) Then
                CMD_languages()
            ElseIf Txt = Mid("score", 1, nputlen) Then
                CMD_score()
            ElseIf Txt = Mid("equip", 1, nputlen) Then
                CMD_equip()
            ElseIf cmdvar = Mid("!gm_summon", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_gm_summon(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("!gm_gorandom", 1, nputlen) And nputlen > 4 Then 'nputlen > 4 so it loads help on !gm
                CMD_gm_gorandom(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("!gm_gostart", 1, nputlen) And nputlen > 4 Then 'nputlen>4 so it loads help on !gm
                CMD_gm_gostart(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("drop all", 1, nputlen) Or Txt = Mid("drop everything", 1, nputlen) Then
                CMD_dropall(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("remove all", 1, nputlen) Or Txt = Mid("remove everything", 1, nputlen) Then
                CMD_removeall(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("remove", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_removeall(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("wear", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_wear(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("save", 1, nputlen) Then
                CMD_save(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("drop", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_drop(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("pick", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_pick(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("bury", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_bury(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("sacrifice", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_sacrifice(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("take", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_take(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("eat", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_eat(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("drink", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_drink(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("affects", 1, nputlen) Then
                CMD_affects(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("calendar", 1, nputlen) Then
                CMD_calendar(Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("time", 1, nputlen) Then
                CMD_time(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editserver_minutes", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editserver_minutes(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editserver_hours", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editserver_hours(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editserver_days", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editserver_days(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editserver_months", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editserver_months(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editserver_years", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editserver_years(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editserver_eras", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editserver_eras(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("quests", 1, nputlen) Then
                CMD_quests(Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_northexit", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_northexit(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_southexit", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_southexit(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_eastexit", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_eastexit(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_westexit", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_westexit(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_upexit", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_upexit(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_downexit", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_downexit(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_description", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_description(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf cmdvar = Mid("!editcur_characters", 1, cmdlen) And nputlen >= cmdlen + 1 Then
                CMD_editcur_characters(CaseSensitive, Txt, cmdlen, nputlen)
            ElseIf Txt = Mid("!prev_dumpmaps", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpmaps()
            ElseIf Txt = Mid("!prev_dumpemotes", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpemotes()
            ElseIf Txt = Mid("!prev_dumpmobiles", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpmobiles()
            ElseIf Txt = Mid("!prev_dumpplayers", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpplayers()
            ElseIf Txt = Mid("!prev_dumpscripts", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpscripts()
            ElseIf Txt = Mid("!prev_dumpitems", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpitems()
            ElseIf Txt = Mid("!prev_dumpcustomitems", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_dumpcustomitems()
            ElseIf Txt = Mid("!prev_quest_information", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_quest_information()
            ElseIf Txt = Mid("!prev_equip_information", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_equip_information()
            ElseIf Txt = Mid("!prev_inv_information", 1, nputlen) And Len(Txt) > 6 Then
                CMD_prev_inv_information()
            ElseIf cmdvar = Mid("!prev_loadsector", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_prev_loadsector(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!gm_goto", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_gm_goto(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_vern", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_vern(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_dover", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_dover(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_sovern", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_sovern(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_bankvern", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_bankvern(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_bankdover", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_bankdover(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_banksovern", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_banksovern(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_hunger", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_hunger(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_thirst", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_thirst(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_curhp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_curhp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_maxhp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_maxhp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_curwp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_curwp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_maxwp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_maxwp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_cursp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_cursp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_maxsp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_maxsp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_strmod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_strmod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_strmax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_strmax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_dexmod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_dexmod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_dexmax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_dexmax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_conmod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_conmod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_conmax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_conmax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_intmod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_intmod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_intmax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_intmax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_wismod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_wismod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_wismax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_wismax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_chamod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_chamod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_chamax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_chamax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_lucmod", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_lucmod(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_lucmax", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_lucmax(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_sleep", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_sleep(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_level", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_level(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_gender", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_gender(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_additem", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_additem(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_password", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_password(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_curxp", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_curxp(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_unarmed_dienum", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_unarmed_dienum(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_unarmed_dietype", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_unarmed_dietype(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_unarmed_speed", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_unarmed_speed(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_practices", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_practices(Txt, cmdlen)
            ElseIf cmdvar = Mid("!set_userdat_trains", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_set_userdat_trains(Txt, cmdlen)
            ElseIf Txt = Mid("!prev_cursector", 1, nputlen) Then
                CMD_prev_cursector(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!prev_loadmob", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_prev_loadmob(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!prev_loaditem", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_prev_loaditem(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!prev_loaditem", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_get(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("examine", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_examine(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_get", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_get(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_dir", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_dir(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_put", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_put(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_del", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_del(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_rem", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_rem(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_cur", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_cur(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_upd", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_upd(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("!server_pin", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_server_pin(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("pdesc", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_pdesc(CaseSensitive, nputlen, cmdlen)
            ElseIf cmdvar = Mid("exit", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_exitprogram(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("quit", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_exitprogram(Txt, nputlen, cmdlen)
            ElseIf cmdvar = Mid("hidecommunicationreturns", 1, cmdlen) And nputlen > cmdlen + 1 Then
                CMD_HideCommunicationReturns(Txt, nputlen, cmdlen)
            Else
                TestEmoteAndAbility(Txt, nputlen, cmdlen)
            End If
        End If
        'Send intro text before introduction requests
        If MainProgram.State = "PreIntroduction" Then
            PreIntro(Txt, nputlen)
        End If
        'show provincial information before requests
        If MainProgram.State = "SHOWLoginProvince" Then
            ShowLoginProvince(Txt, nputlen)
        End If
        'show rode information before requests
        If MainProgram.State = "SHOWLoginRode" Then
            ShowLoginRode(Txt, nputlen)
        End If
        'show temple options and information before requests
        If MainProgram.State = "SHOWLoginTemple" Then
            ShowLoginTemple(Txt, nputlen)
        End If
    End Sub
#Region "States"
#Region "Open State"
#Region "Movement Commands"
    Private Sub CMD_southwards(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        If MainProgram.User_Resting = False Then
            If MainProgram.User_CurHP > 0 Then
                If MainProgram.UserLocation_SouthCNCT <> 0 And RandomMap = False Or RandomMap = True And GenerateMap.TestDirection("South") = True Then 'let randommap enter this if to reduce stamina and then be sent to it's appropriate subroutine afterwards
                    MainProgram.RestedWaitTime = 0
                    MainProgram.User_CurSP -= MainProgram.User_MovementStaminaRemover
                    If MainProgram.User_CurSP < 0 Then
                        MainProgram.User_CurSP += MainProgram.User_MovementStaminaRemover
                        MainProgram.SND("/gYou are too tired to move, try /wrest/ging, /wsit/gting or /wsleep/ging.")
                    Else
                        MainProgram.MainFlash.SetVariable("spf.sp", MainProgram.User_CurSP + "/" + MainProgram.User_MaxSP)
                        MainProgram.MainFlash.TGotoFrame("spbar", 100 - (100 / MainProgram.User_MaxSP * MainProgram.User_CurSP))
                        MainProgram.MainFlash.TGotoFrame("spf", 1)
                        MainProgram.MainFlash.TPlay("spf")
                        'if the user is on a randomly generated map then process their movement correctly
                        If RandomMap = True Then 'random maps don't use resources
                            MoveInDirection("South")
                            Exit Sub
                        End If
                        'if the user is not on a randomly generated map then process their movement correctly
                        If MainProgram.UserLocation_SouthMap <> 0 Then
                            Dim MapHeaderTemp As String = MainProgram.GetFileContents(MainProgram.DirMapHeader, MainProgram.sErr)
                            Dim MapHeaderTempLast As String
                            Dim x As Integer, y As Integer
                            For x = 5 + Len(LTrim(Str(MainProgram.UserLocation_SouthMap))) + InStr(MapHeaderTemp, "MAP#" + LTrim(Str(MainProgram.UserLocation_SouthMap)) + "(") To Len(MapHeaderTemp) Step 1
                                If Mid(MapHeaderTemp, x, 1) = "." Then
                                    For y = x + 1 To Len(MapHeaderTemp) Step 1
                                        If Mid(MapHeaderTemp, y, 1) = ")" Then
                                            MapHeaderTempLast = Mid(MapHeaderTemp, x + 1, y - x - 1)
                                            MainProgram.DirMaps = Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast)
                                            MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps)
                                            MainProgram.DirMapCur = Replace(Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast), "Base.TG", ".TG")
                                            MainProgram.CurMapData = MainProgram.GetFileContents(MainProgram.DirMapCur)
                                            MainProgram.UserLocation_CurrentMap = MapHeaderTempLast
                                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, True)
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                        Else
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                        End If
                    End If
                Else
                    MainProgram.SND("/rCan't move in that direction.")
                End If
            Else
                MainProgram.SND("/gYou are too hurt to move, try resting or sleeping.")
            End If
        Else
            MainProgram.SND("/gYou can't move anywhere while sitting down, try standing up.")
        End If
    End Sub
    Private Sub CMD_northwards(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            If MainProgram.User_CurHP > 0 Then
                If MainProgram.UserLocation_NorthCNCT <> 0 And RandomMap = False Or RandomMap = True And GenerateMap.TestDirection("North") = True Then 'let randommap enter this if to reduce stamina and then be sent to it's appropriate subroutine afterwards
                    MainProgram.RestedWaitTime = 0
                    MainProgram.User_CurSP -= MainProgram.User_MovementStaminaRemover
                    If MainProgram.User_CurSP < 0 Then
                        MainProgram.User_CurSP += MainProgram.User_MovementStaminaRemover
                        MainProgram.SND("/gYou are too tired to move, try /wrest/ging, /wsit/gting or /wsleep/ging.")
                    Else
                        MainProgram.MainFlash.SetVariable("spf.sp", MainProgram.User_CurSP + "/" + MainProgram.User_MaxSP)
                        MainProgram.MainFlash.TGotoFrame("spbar", 100 - (100 / MainProgram.User_MaxSP * MainProgram.User_CurSP))
                        MainProgram.MainFlash.TGotoFrame("spf", 1)
                        MainProgram.MainFlash.TPlay("spf")
                        'if the user is on a randomly generated map then process their movement correctly
                        If RandomMap = True Then 'random maps don't use resources
                            MoveInDirection("North")
                            Exit Sub
                        End If
                        'if the user is not on a randomly generated map then process their movement correctly
                        If MainProgram.UserLocation_NorthMap <> 0 Then
                            Dim MapHeaderTemp As String = MainProgram.GetFileContents(MainProgram.DirMapHeader, MainProgram.sErr)
                            Dim MapHeaderTempLast As String
                            Dim x As Integer, y As Integer
                            For x = 5 + Len(LTrim(Str(MainProgram.UserLocation_NorthMap))) + InStr(MapHeaderTemp, "MAP#" + LTrim(Str(MainProgram.UserLocation_NorthMap)) + "(") To Len(MapHeaderTemp) Step 1
                                If Mid(MapHeaderTemp, x, 1) = "." Then
                                    For y = x + 1 To Len(MapHeaderTemp) Step 1
                                        If Mid(MapHeaderTemp, y, 1) = ")" Then
                                            MapHeaderTempLast = Mid(MapHeaderTemp, x + 1, y - x - 1)
                                            MainProgram.DirMaps = Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast)
                                            MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps)
                                            MainProgram.DirMapCur = Replace(Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast), "Base.TG", ".TG")
                                            MainProgram.CurMapData = MainProgram.GetFileContents(MainProgram.DirMapCur)
                                            MainProgram.UserLocation_CurrentMap = MapHeaderTempLast
                                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, True)
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                        Else
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                        End If
                    End If
                Else
                    MainProgram.SND("/rCan't move in that direction.")
                End If
            Else
                MainProgram.SND("/gYou are too hurt to move, try resting or sleeping.")
            End If
        Else
            MainProgram.SND("/gYou can't move anywhere while sitting down, try standing up.")
        End If
    End Sub
    Private Sub CMD_eastwards(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            If MainProgram.User_CurHP > 0 Then
                If MainProgram.UserLocation_EastCNCT <> 0 And RandomMap = False Or RandomMap = True And GenerateMap.TestDirection("East") = True Then 'let randommap enter this if to reduce stamina and then be sent to it's appropriate subroutine afterwards
                    MainProgram.RestedWaitTime = 0
                    MainProgram.User_CurSP -= MainProgram.User_MovementStaminaRemover
                    If MainProgram.User_CurSP < 0 Then
                        MainProgram.User_CurSP += MainProgram.User_MovementStaminaRemover
                        MainProgram.SND("/gYou are too tired to move, try /wrest/ging, /wsit/gting or /wsleep/ging.")
                    Else
                        MainProgram.MainFlash.SetVariable("spf.sp", MainProgram.User_CurSP + "/" + MainProgram.User_MaxSP)
                        MainProgram.MainFlash.TGotoFrame("spbar", 100 - (100 / MainProgram.User_MaxSP * MainProgram.User_CurSP))
                        MainProgram.MainFlash.TGotoFrame("spf", 1)
                        MainProgram.MainFlash.TPlay("spf")
                        'if the user is on a randomly generated map then process their movement correctly
                        If RandomMap = True Then 'random maps don't use resources
                            MoveInDirection("East")
                            Exit Sub
                        End If
                        'if the user is not on a randomly generated map then process their movement correctly
                        If MainProgram.UserLocation_EastMap <> 0 Then
                            Dim MapHeaderTemp As String = MainProgram.GetFileContents(MainProgram.DirMapHeader, MainProgram.sErr)
                            Dim MapHeaderTempLast As String
                            Dim x As Integer, y As Integer
                            For x = 5 + Len(LTrim(Str(MainProgram.UserLocation_EastMap))) + InStr(MapHeaderTemp, "MAP#" + LTrim(Str(MainProgram.UserLocation_EastMap)) + "(") To Len(MapHeaderTemp) Step 1
                                If Mid(MapHeaderTemp, x, 1) = "." Then
                                    For y = x + 1 To Len(MapHeaderTemp) Step 1
                                        If Mid(MapHeaderTemp, y, 1) = ")" Then
                                            MapHeaderTempLast = Mid(MapHeaderTemp, x + 1, y - x - 1)
                                            MainProgram.DirMaps = Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast)
                                            MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps)
                                            MainProgram.DirMapCur = Replace(Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast), "Base.TG", ".TG")
                                            MainProgram.CurMapData = MainProgram.GetFileContents(MainProgram.DirMapCur)
                                            MainProgram.UserLocation_CurrentMap = MapHeaderTempLast
                                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, True)
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                        Else
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                        End If
                    End If
                Else
                    MainProgram.SND("/rCan't move in that direction.")
                End If
            Else
                MainProgram.SND("/gYou are too hurt to move, try resting or sleeping.")
            End If
        Else
            MainProgram.SND("/gYou can't move anywhere while sitting down, try standing up.")
        End If
    End Sub
    Private Sub CMD_upwards(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            If MainProgram.User_CurHP > 0 Then
                If MainProgram.UserLocation_UpCNCT <> 0 And RandomMap = False Or RandomMap = True And GenerateMap.TestDirection("Up") = True Then 'let randommap enter this if to reduce stamina and then be sent to it's appropriate subroutine afterwards
                    MainProgram.RestedWaitTime = 0
                    MainProgram.User_CurSP -= MainProgram.User_MovementStaminaRemover
                    If MainProgram.User_CurSP < 0 Then
                        MainProgram.User_CurSP += MainProgram.User_MovementStaminaRemover
                        MainProgram.SND("/gYou are too tired to move, try /wrest/ging, /wsit/gting or /wsleep/ging.")
                    Else
                        MainProgram.MainFlash.SetVariable("spf.sp", MainProgram.User_CurSP + "/" + MainProgram.User_MaxSP)
                        MainProgram.MainFlash.TGotoFrame("spbar", 100 - (100 / MainProgram.User_MaxSP * MainProgram.User_CurSP))
                        MainProgram.MainFlash.TGotoFrame("spf", 1)
                        MainProgram.MainFlash.TPlay("spf")
                        'if the user is on a randomly generated map then process their movement correctly
                        If RandomMap = True Then 'random maps don't use resources
                            MoveInDirection("Up")
                            Exit Sub
                        End If
                        'if the user is not on a randomly generated map then process their movement correctly
                        If MainProgram.UserLocation_UpMap <> 0 Then
                            Dim MapHeaderTemp As String = MainProgram.GetFileContents(MainProgram.DirMapHeader, MainProgram.sErr)
                            Dim MapHeaderTempLast As String
                            Dim x As Integer, y As Integer
                            For x = 5 + Len(LTrim(Str(MainProgram.UserLocation_UpMap))) + InStr(MapHeaderTemp, "MAP#" + LTrim(Str(MainProgram.UserLocation_UpMap)) + "(") To Len(MapHeaderTemp) Step 1
                                If Mid(MapHeaderTemp, x, 1) = "." Then
                                    For y = x + 1 To Len(MapHeaderTemp) Step 1
                                        If Mid(MapHeaderTemp, y, 1) = ")" Then
                                            MapHeaderTempLast = Mid(MapHeaderTemp, x + 1, y - x - 1)
                                            MainProgram.DirMaps = Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast)
                                            MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps)
                                            MainProgram.DirMapCur = Replace(Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast), "Base.TG", ".TG")
                                            MainProgram.CurMapData = MainProgram.GetFileContents(MainProgram.DirMapCur)
                                            MainProgram.UserLocation_CurrentMap = MapHeaderTempLast
                                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, True)
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                        Else
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                        End If
                    End If
                Else
                    MainProgram.SND("/gYou are too hurt to move, try resting or sleeping.")
                End If
            Else
                MainProgram.SND("/rCan't move in that direction.")
            End If
        Else
            MainProgram.SND("/gYou can't move anywhere while sitting down, try standing up.")
        End If
    End Sub
    Private Sub CMD_downwards(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            If MainProgram.User_CurHP > 0 Then
                If MainProgram.UserLocation_DownCNCT <> 0 And RandomMap = False Or RandomMap = True And GenerateMap.TestDirection("Down") = True Then 'let randommap enter this if to reduce stamina and then be sent to it's appropriate subroutine afterwards
                    MainProgram.RestedWaitTime = 0
                    MainProgram.User_CurSP -= MainProgram.User_MovementStaminaRemover
                    If MainProgram.User_CurSP < 0 Then
                        MainProgram.User_CurSP += MainProgram.User_MovementStaminaRemover
                        MainProgram.SND("/gYou are too tired to move, try /wrest/ging, /wsit/gting or /wsleep/ging.")
                    Else
                        MainProgram.MainFlash.SetVariable("spf.sp", MainProgram.User_CurSP + "/" + MainProgram.User_MaxSP)
                        MainProgram.MainFlash.TGotoFrame("spbar", 100 - (100 / MainProgram.User_MaxSP * MainProgram.User_CurSP))
                        MainProgram.MainFlash.TGotoFrame("spf", 1)
                        MainProgram.MainFlash.TPlay("spf")
                        'if the user is on a randomly generated map then process their movement correctly
                        If RandomMap = True Then 'random maps don't use resources
                            MoveInDirection("Down")
                            Exit Sub
                        End If
                        'if the user is not on a randomly generated map then process their movement correctly
                        If MainProgram.UserLocation_DownMap <> 0 Then
                            Dim MapHeaderTemp As String = MainProgram.GetFileContents(MainProgram.DirMapHeader, MainProgram.sErr)
                            Dim MapHeaderTempLast As String
                            Dim x As Integer, y As Integer
                            For x = 5 + Len(LTrim(Str(MainProgram.UserLocation_DownMap))) + InStr(MapHeaderTemp, "MAP#" + LTrim(Str(MainProgram.UserLocation_DownMap)) + "(") To Len(MapHeaderTemp) Step 1
                                If Mid(MapHeaderTemp, x, 1) = "." Then
                                    For y = x + 1 To Len(MapHeaderTemp) Step 1
                                        If Mid(MapHeaderTemp, y, 1) = ")" Then
                                            MapHeaderTempLast = Mid(MapHeaderTemp, x + 1, y - x - 1)
                                            MainProgram.DirMaps = Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast)
                                            MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps)
                                            MainProgram.DirMapCur = Replace(Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast), "Base.TG", ".TG")
                                            MainProgram.CurMapData = MainProgram.GetFileContents(MainProgram.DirMapCur)
                                            MainProgram.UserLocation_CurrentMap = MapHeaderTempLast
                                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, True)
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                        Else
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                        End If
                    End If
                Else
                    MainProgram.SND("/rCan't move in that direction.")
                End If
            Else
                MainProgram.SND("/gYou are too hurt to move, try resting or sleeping.")
            End If
        Else
            MainProgram.SND("/gYou can't move anywhere while sitting down, try standing up.")
        End If
    End Sub
    Private Sub CMD_westwards(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            If MainProgram.User_CurHP > 0 Then
                If MainProgram.UserLocation_WestCNCT <> 0 And RandomMap = False Or RandomMap = True And GenerateMap.TestDirection("West") = True Then 'let randommap enter this if to reduce stamina and then be sent to it's appropriate subroutine afterwards
                    MainProgram.RestedWaitTime = 0
                    MainProgram.User_CurSP -= MainProgram.User_MovementStaminaRemover
                    If MainProgram.User_CurSP < 0 Then
                        MainProgram.User_CurSP += MainProgram.User_MovementStaminaRemover
                        MainProgram.SND("/gYou are too tired to move, try /wrest/ging, /wsit/gting or /wsleep/ging.")
                    Else
                        MainProgram.MainFlash.SetVariable("spf.sp", MainProgram.User_CurSP + "/" + MainProgram.User_MaxSP)
                        MainProgram.MainFlash.TGotoFrame("spbar", 100 - (100 / MainProgram.User_MaxSP * MainProgram.User_CurSP))
                        MainProgram.MainFlash.TGotoFrame("spf", 1)
                        MainProgram.MainFlash.TPlay("spf")
                        'if the user is on a randomly generated map then process their movement correctly
                        If RandomMap = True Then 'random maps don't use resources
                            MoveInDirection("West")
                            Exit Sub
                        End If
                        'if the user is not on a randomly generated map then process their movement correctly
                        If MainProgram.UserLocation_WestMap <> 0 Then
                            Dim MapHeaderTemp As String = MainProgram.GetFileContents(MainProgram.DirMapHeader, MainProgram.sErr)
                            Dim MapHeaderTempLast As String
                            Dim x As Integer, y As Integer
                            For x = 5 + Len(LTrim(Str(MainProgram.UserLocation_WestMap))) + InStr(MapHeaderTemp, "MAP#" + LTrim(Str(MainProgram.UserLocation_WestMap)) + "(") To Len(MapHeaderTemp) Step 1
                                If Mid(MapHeaderTemp, x, 1) = "." Then
                                    For y = x + 1 To Len(MapHeaderTemp) Step 1
                                        If Mid(MapHeaderTemp, y, 1) = ")" Then
                                            MapHeaderTempLast = Mid(MapHeaderTemp, x + 1, y - x - 1)
                                            MainProgram.DirMaps = Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast)
                                            MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps)
                                            MainProgram.DirMapCur = Replace(Replace(MainProgram.DirMaps, MainProgram.UserLocation_CurrentMap, MapHeaderTempLast), "Base.TG", ".TG")
                                            MainProgram.CurMapData = MainProgram.GetFileContents(MainProgram.DirMapCur)
                                            MainProgram.UserLocation_CurrentMap = MapHeaderTempLast
                                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, True)
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                        Else
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                        End If
                    End If
                Else
                    MainProgram.SND("/rCan't move in that direction.")
                End If
            Else
                MainProgram.SND("/gYou are too hurt to move, try resting or sleeping.")
            End If
        Else
            MainProgram.SND("/gYou can't move anywhere while sitting down, try standing up.")
        End If
    End Sub
#End Region
#Region "Other Commands"
    Private Sub CMD_examine(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        MainProgram.ItemData = MainProgram.GetFileContents(MainProgram.DirItems, MainProgram.sErr)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmp0 As Integer, found As Boolean = False
        For tmp0 = 0 To 39 Step 1
            If MainProgram.User_Inventory(tmp0) <> "" Then
                If InStr(LCase(LTrim(MainProgram.User_Inventory(tmp0))), tmpa) Then
                    LoadItem.LoadItem(MainProgram.User_InventoryNUM(tmp0))
                    found = True
                End If
            End If
        Next
        If found = True Then
            Dim tmp1 As Integer = Val(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = InStr(MainProgram.ItemData, "TOTAL#") To Len(MainProgram.ItemData) Step 1
                If Mid(MainProgram.ItemData, tmp0, 1) = "(" Then
                    tmpa = Mid(MainProgram.ItemData, InStr(MainProgram.ItemData, "TOTAL#") + 6, tmp0 - 6 - InStr(MainProgram.ItemData, "TOTAL#"))
                    Exit For
                End If
            Next
            If tmp1 <= Val(tmpa) Then
                LoadItem.LoadItem(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
                If MainProgram.ItemData_BasicType = "Miscellaneous" Then
                    MainProgram.SND("/c*/C**********************************************")
                    MainProgram.SND(MainProgram.AddSpace("/c* Base Type:", 23) + "/zMiscellaneous")
                    MainProgram.SND(MainProgram.AddSpace("/c* Name:/z ", 25) + MainProgram.ItemData_ITEMN)
                    MainProgram.SND(MainProgram.AddSpace("/c* Short:/z ", 25) + MainProgram.ItemData_SHORT)
                    MainProgram.SND(MainProgram.AddSpace("/c* Look:/z ", 25) + MainProgram.ItemData_LOOKD)
                    MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z ", 25) + MainProgram.ItemData_Weight)
                    MainProgram.SND(MainProgram.AddSpace("/c* Purchasable Area:/z ", 25) + MainProgram.ItemData_PurchasableAreas)
                    MainProgram.SND(MainProgram.AddSpace("/c* Worth:/z ", 25) + MainProgram.ItemData_Worth)
                    MainProgram.SND("/c***********************************************")
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Sex:/z ", 25) + MainProgram.ItemData_SexRequirement)
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Level:/z ", 25) + MainProgram.ItemData_LevelRequirement)
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Class:/z ", 25) + MainProgram.ItemData_ClassRequirement)
                    MainProgram.SND("/c*/C**********************************************")
                ElseIf MainProgram.ItemData_BasicType = "Armor" Then
                    MainProgram.SND("/c*/C**********************************************")
                    MainProgram.SND(MainProgram.AddSpace("/c* Base Type:", 23) + "/zArmor")
                    MainProgram.SND(MainProgram.AddSpace("/c* Name:/z ", 25) + MainProgram.ItemData_ITEMN)
                    MainProgram.SND(MainProgram.AddSpace("/c* Look:/z ", 25) + MainProgram.ItemData_LOOKD)
                    MainProgram.SND(MainProgram.AddSpace("/c* Armor Type:/z ", 25) + MainProgram.ItemData_ProfReq)
                    MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z ", 25) + MainProgram.ItemData_Weight)
                    MainProgram.SND(MainProgram.AddSpace("/c* Purchasable Area:/z ", 25) + MainProgram.ItemData_PurchasableAreas)
                    MainProgram.SND(MainProgram.AddSpace("/c* Worth:/z ", 25) + MainProgram.ItemData_Worth)
                    MainProgram.SND("/c***********************************************")
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Sex:/z ", 25) + MainProgram.ItemData_SexRequirement)
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Level:/z ", 25) + MainProgram.ItemData_LevelRequirement)
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Class:/z ", 25) + MainProgram.ItemData_ClassRequirement)
                    MainProgram.SND("/c*/C**********************************************")
                ElseIf MainProgram.ItemData_BasicType = "Weapon" Then
                    MainProgram.SND("/c*/C**********************************************")
                    MainProgram.SND(MainProgram.AddSpace("/c* Base Type: ", 23) + "/zWeapon")
                    MainProgram.SND(MainProgram.AddSpace("/c* Name:/z ", 25) + MainProgram.ItemData_ITEMN)
                    MainProgram.SND(MainProgram.AddSpace("/c* Look:/z ", 25) + MainProgram.ItemData_LOOKD)
                    MainProgram.SND(MainProgram.AddSpace("/c* Weapon Type:/z ", 25) + MainProgram.ItemData_TYPE)
                    MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z ", 25) + MainProgram.ItemData_Weight)
                    MainProgram.SND(MainProgram.AddSpace("/c* Craftsmanship:/z ", 25) + MainProgram.ItemData_Craftsmanship)
                    MainProgram.SND(MainProgram.AddSpace("/c* Two Handed:/z ", 25) + MainProgram.ItemData_2Handed)
                    MainProgram.SND(MainProgram.AddSpace("/c* mainprogram.Damage Type:/z ", 25) + MainProgram.ItemData_DamageType)
                    MainProgram.SND(MainProgram.AddSpace("/c* Purchasable Area:/z ", 25) + MainProgram.ItemData_PurchasableAreas)
                    MainProgram.SND(MainProgram.AddSpace("/c* Worth:/z ", 25) + MainProgram.ItemData_Worth)
                    MainProgram.SND("/c***********************************************")
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Sex:/z ", 25) + MainProgram.ItemData_SexRequirement)
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Level:/z ", 25) + MainProgram.ItemData_LevelRequirement)
                    MainProgram.SND(MainProgram.AddSpace("/c* Required Class:/z ", 25) + MainProgram.ItemData_ClassRequirement)
                    MainProgram.SND("/c*/C**********************************************")
                End If
            End If
        Else
            MainProgram.SND("/wYou don't have that to examine.")
        End If
    End Sub
    Private Sub CMD_exitprogram(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If tmpa = Mid("yes", 1, Len(tmpa)) Then
            SavePlayer.saveplayer("1")
            Application.Exit()
        ElseIf tmpa = Mid("no", 1, Len(tmpa)) Then
            Application.Exit()
        Else
            MainProgram.SND("/RPlease MainProgram.State whether or not to save on exit. /yFor help file on exiting program type 'exit' or 'quit'.")
            MainProgram.SND("/y  Proper format : /w'/gexit yes/w'/y - saves game on exit. 'y' also works instead of 'yes'")
            MainProgram.SND("/y                  /w'/gexit no/w'/y - exits game without saving. 'n' also works instead of 'no'")
        End If
    End Sub
    Private Sub CMD_look()
        If RandomMap = False Then
            LoadSector.LoadSector(MainProgram.UserLocation_Sector, 1)
        Else
            GenerateMap.ShowRoom()
        End If
    End Sub
    Private Sub CMD_practice(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpA As String = LCase(LTrim(RTrim(Mid(txt, cmdlen + 2, Len(txt)))))
        Dim PrevAmount As Short
        If MainProgram.User_PracticePoints > 0 Then
            Dim tmpx As Short
            For tmpx = 0 To 50 Step 1
                If tmpA = Mid(LCase(MainProgram.AbilityName(tmpx)), 1, Len(tmpA)) Then
                    If MainProgram.AbilityLearned(tmpx) < 75 Then
                        PrevAmount = MainProgram.AbilityLearned(tmpx)
                        MainProgram.AbilityLearned(tmpx) += MainProgram.User_Intelligencemod
                        If MainProgram.AbilityLearned(tmpx) > 75 Then MainProgram.AbilityLearned(tmpx) = 75
                        MainProgram.SND("/gYou increased you effeciency with " + MainProgram.AbilityName(tmpx) + " by " + LTrim(Str(MainProgram.AbilityLearned(tmpx) - PrevAmount)) + ".")
                        MainProgram.User_PracticePoints -= 1
                    Else
                        MainProgram.SND("/gYou can't practice that anymore.")
                    End If
                    Exit For
                End If
            Next
        Else
            MainProgram.SND("/RYou don't have any practice points.")
            MainProgram.SND("/yFor more information try 'help practice'")
        End If
    End Sub
    Private Sub CMD_traininfo()
        MainProgram.SND("/wTraining Points: /g" + LTrim(Str(MainProgram.User_TrainingPoints)))
        Dim trainingstats As String = "/g"
        If MainProgram.User_Strength <> MainProgram.User_StrengthMax Then trainingstats += "Str/w[/G" + LTrim(Str(MainProgram.User_Strength)) + "/w//G" + LTrim(Str(MainProgram.User_StrengthMax)) + "/w]/g"
        If MainProgram.User_Dexterity <> MainProgram.User_DexterityMax Then trainingstats += " Dex/w[/G" + LTrim(Str(MainProgram.User_Dexterity)) + "/w//G" + LTrim(Str(MainProgram.User_DexterityMax)) + "/w]/g"
        If MainProgram.User_Constitution <> MainProgram.User_ConstitutionMax Then trainingstats += " Con/w[/G" + LTrim(Str(MainProgram.User_Constitution)) + "/w//G" + LTrim(Str(MainProgram.User_ConstitutionMax)) + "/w]/g"
        If MainProgram.User_Intelligence <> MainProgram.User_IntelligenceMax Then trainingstats += " Int/w[/G" + LTrim(Str(MainProgram.User_Intelligence)) + "/w//G" + LTrim(Str(MainProgram.User_IntelligenceMax)) + "/w]/g"
        If MainProgram.User_Wisdom <> MainProgram.User_WisdomMax Then trainingstats += " Wis/w[/G" + LTrim(Str(MainProgram.User_Wisdom)) + "/w//G" + LTrim(Str(MainProgram.User_WisdomMax)) + "/w]/g"
        If MainProgram.User_Charisma <> MainProgram.User_CharismaMax Then trainingstats += " Cha/w[/G" + LTrim(Str(MainProgram.User_Charisma)) + "/w//G" + LTrim(Str(MainProgram.User_CharismaMax)) + "/w]/g"
        If MainProgram.User_Luck <> MainProgram.User_LuckMax Then trainingstats += " Luc/w[/G" + LTrim(Str(MainProgram.User_Luck)) + "/w//G" + LTrim(Str(MainProgram.User_LuckMax)) + "/w]/g"
        MainProgram.SND(LTrim(Replace(trainingstats, "/g ", " /g")) + " HP WP SP")
        MainProgram.SND("/yFor more information try 'help train'")
    End Sub
    Private Sub CMD_ctrain(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpA As String = LCase(LTrim(RTrim(Mid(txt, cmdlen, Len(txt)))))
        If Val(tmpA) > 0 Then
            If MainProgram.User_TrainingPoints >= Val(tmpA) Then
                MainProgram.User_PracticePoints += Val(tmpA) * 3
                MainProgram.User_TrainingPoints -= Val(tmpA)
                MainProgram.SND("/YYou converted " + tmpA + " training points into " + LTrim(Str(Val(tmpA) * 3)) + " practice points.")
            Else
                MainProgram.SND("/RYou don't have that many training points.")
                MainProgram.SND("/yFor more information try 'help ctrain'.")
            End If
        Else
            MainProgram.SND("/RNot enough training points specified.")
            MainProgram.SND("/yFor more information try 'help ctrain'.")
        End If
    End Sub
    Private Sub CMD_cpractice(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpA As String = LCase(LTrim(RTrim(Mid(txt, cmdlen, Len(txt)))))
        If Math.Floor(Val(tmpA) / 3) > 0 Then
            If MainProgram.User_PracticePoints >= Val(tmpA) Then
                MainProgram.User_PracticePoints -= Math.Floor(Val(tmpA))
                MainProgram.User_TrainingPoints += Math.Floor(Val(tmpA) / 3)
                MainProgram.SND("/YYou converted " + tmpA + " practice points into " + LTrim(Str(Math.Floor(Val(tmpA) / 3))) + " training points.")
            Else
                MainProgram.SND("/RYou don't have that many practice points.")
                MainProgram.SND("/yFor more information try 'help cpractice'.")
            End If
        Else
            MainProgram.SND("/RNot enough practice points specified.")
            MainProgram.SND("/yFor more information try 'help cpractice'.")
        End If
    End Sub
    Private Sub CMD_train(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpA As String = LCase(LTrim(RTrim(Mid(txt, nputlen + 1, Len(txt)))))
        If MainProgram.User_TrainingPoints > 0 Then
            If tmpA = Mid("strength", 1, Len(tmpA)) Then
                If MainProgram.User_Strength = MainProgram.User_StrengthMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Strength += 1
                    MainProgram.User_Strengthmod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.SND("/gYou increased your strength by 1.")
                End If
            ElseIf tmpA = Mid("dexterity", 1, Len(tmpA)) Then
                If MainProgram.User_Dexterity = MainProgram.User_DexterityMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Dexterity += 1
                    MainProgram.User_Dexteritymod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.User_CurSP += 10
                    MainProgram.User_MaxSP += 10
                    MainProgram.SND("/gYou increased your dexterity by 1.")
                End If
            ElseIf tmpA = Mid("constitution", 1, Len(tmpA)) Then
                If MainProgram.User_Constitution = MainProgram.User_ConstitutionMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Constitution += 1
                    MainProgram.User_Constitutionmod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.User_CurHP += 10
                    MainProgram.User_MaxHP += 10
                    MainProgram.SND("/gYou increased your constitution by 1.")
                End If
            ElseIf tmpA = Mid("intelligence", 1, Len(tmpA)) Then
                If MainProgram.User_Intelligence = MainProgram.User_IntelligenceMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Intelligence += 1
                    MainProgram.User_Intelligencemod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.User_CurWP += 10
                    MainProgram.User_MaxWP += 10
                    MainProgram.SND("/gYou increased your intelligence by 1.")
                End If
            ElseIf tmpA = Mid("wisdom", 1, Len(tmpA)) Then
                If MainProgram.User_Wisdom = MainProgram.User_WisdomMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Wisdom += 1
                    MainProgram.User_Wisdommod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.SND("/gYou increased your wisdom by 1.")
                End If
            ElseIf tmpA = Mid("charisma", 1, Len(tmpA)) Then
                If MainProgram.User_Charisma = MainProgram.User_CharismaMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Charisma += 1
                    MainProgram.User_Charismamod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.SND("/gYou increased your charisma by 1.")
                End If
            ElseIf tmpA = Mid("luck", 1, Len(tmpA)) Then
                If MainProgram.User_Luck = MainProgram.User_LuckMax Then
                    MainProgram.SND("/gYou can't increase that anymore.")
                Else
                    MainProgram.User_Luck += 1
                    MainProgram.User_Luckmod += 1
                    MainProgram.User_TrainingPoints -= 1
                    MainProgram.SND("/gYou increased your luck by 1.")
                End If
            ElseIf tmpA = Mid("hp", 1, Len(tmpA)) Or tmpA = Mid("hitpoints", 1, Len(tmpA)) Or tmpA = Mid("hit points", 1, Len(tmpA)) Then
                MainProgram.User_MaxHP += 10
                MainProgram.User_CurHP += 10
                MainProgram.User_TrainingPoints -= 1
                MainProgram.SND("/gYou increased your hitpoints by 10.")
            ElseIf tmpA = Mid("wp", 1, Len(tmpA)) Or tmpA = Mid("willpoints", 1, Len(tmpA)) Or tmpA = Mid("will points", 1, Len(tmpA)) Or tmpA = Mid("willpower", 1, Len(tmpA)) Or tmpA = Mid("will power", 1, Len(tmpA)) Then
                MainProgram.User_MaxWP += 10
                MainProgram.User_CurWP += 10
                MainProgram.User_TrainingPoints -= 1
                MainProgram.SND("/gYou increased your willpower by 10.")
            ElseIf tmpA = Mid("sp", 1, Len(tmpA)) Or tmpA = Mid("staminapoints", 1, Len(tmpA)) Or tmpA = Mid("stamina points", 1, Len(tmpA)) Or tmpA = Mid("staminapower", 1, Len(tmpA)) Or tmpA = Mid("stamina power", 1, Len(tmpA)) Or tmpA = Mid("stamina", 1, Len(tmpA)) Then
                MainProgram.User_MaxSP += 10
                MainProgram.User_CurSP += 10
                MainProgram.User_TrainingPoints -= 1
                MainProgram.SND("/gYou increased your stamina by 10.")
            Else
                MainProgram.SND("/RThat isn't a stat.")
                MainProgram.SND("/yFor more information try 'help train'")
            End If
        Else
            MainProgram.SND("/gYou don't have any training points.")
            MainProgram.SND("/yFor more information try 'help train'")
        End If
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_lookin(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmp0 As Integer
        Dim tmpA As String = LTrim(RTrim(Mid(txt, cmdlen + 2, Len(txt))))
        For tmp0 = 1 To Val(MainProgram.CustomItemDataNUM) Step 1
            LoadItem.LoadItem("?" + MainProgram.CustomItemDataNUM)
            If InStr(MainProgram.ItemData_ITEMN, tmpA) Then
                MainProgram.SND("/gNothing found within " + MainProgram.ItemData_ITEMN + "/g.")
            End If
        Next
    End Sub
    Private Sub CMD_skin(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmp0 As Integer
        Dim tmpA As String = LTrim(RTrim(Mid(txt, cmdlen + 2, Len(txt))))
        Dim WeaponString As String
        Dim CorpseString As String, SmallCorpseString As String
        For tmp0 = 1 To Val(MainProgram.CustomItemDataNUM) Step 1
            LoadItem.LoadItem("?" + MainProgram.CustomItemDataNUM)
            If InStr(MainProgram.ItemData_ITEMN, "corpse") Then
                CorpseString = MainProgram.ItemData_ITEMN
                SmallCorpseString = Replace(Replace(MainProgram.ItemData_SHORT, "A ", ""), "An ", "")
                If MainProgram.UserEquip_MainhandNUM <> "0" Then
                    LoadItem.LoadItem(MainProgram.UserEquip_MainhandNUM)
                Else
                    MainProgram.ItemData_DamageType = "Fist"
                    MainProgram.ItemData_ITEMN = "your hands"
                End If
                WeaponString = MainProgram.ItemData_ITEMN
                If MainProgram.ItemData_DamageType = "Bash" Then
                    MainProgram.SND("/gYou can't skin " + CorpseString + "/g with " + WeaponString + "/g.")
                ElseIf MainProgram.ItemData_DamageType = "Slash" Then
                    MainProgram.SND("/gYou can't skin " + CorpseString + "/g with " + WeaponString + "/g.")
                ElseIf MainProgram.ItemData_DamageType = "Fist" Then
                    MainProgram.SND("/gYou can't skin " + CorpseString + "/g with " + WeaponString + "/g.")
                ElseIf MainProgram.ItemData_DamageType = "Exotic" Then
                    MainProgram.SND("/gYou can't skin " + CorpseString + "/g with " + WeaponString + "/g.")
                ElseIf MainProgram.ItemData_DamageType = "Pierce" Then
                    Dim TheVnum As String = ""
                    If Val(MainProgram.ItemData_LevelRequirement) = 0 Then 'implement skinning fur
                        TheVnum = BuildCustomItem("Skin", "Combat", "Light Leather Scraps", "A pile of Light Leather Scraps", "A pile of Light Leather Scraps are here.", "The Leather appears to be fresh.", "No", "0,1", "1 Vern")
                    ElseIf Val(MainProgram.ItemData_LevelRequirement) < 10 Then
                        TheVnum = BuildCustomItem("Skin", "Combat", "Light Leather", "A pile of Light Leather", "A pile of Light Leather is here.", "The Leather appears to be fresh.", "No", "0,1", "15 Vern")
                    ElseIf Val(MainProgram.ItemData_LevelRequirement) < 20 Then
                        TheVnum = BuildCustomItem("Skin", "Combat", "Medium Leather", "A pile of Medium Leather", "A pile of Medium Leather is here.", "The Leather appears to be fresh.", "No", "0,1", "75 Vern")
                    ElseIf Val(MainProgram.ItemData_LevelRequirement) < 30 Then
                        TheVnum = BuildCustomItem("Skin", "Combat", "Heavy Leather", "A pile of Heavy Leather", "A pile of Heavy Leather is here.", "The Leather appears to be fresh.", "No", "0,1", "2 Dover")
                    End If
                    LoadItem.LoadItem(TheVnum)
                    MainProgram.SND("/gYou skin " + CorpseString + "/g with " + WeaponString + "/g and retrieve " + MainProgram.ItemData_ITEMN + "/g.")
                    MainProgram.User_additem(TheVnum)
                    tmpA = SmallCorpseString
                    Dim tmpb As String = LCase("," + MainProgram.MapData_DRTEM + ","), tmpc As String = ""
                    Dim tmp1 As Integer, tmp2 As Integer, tmp3 As Integer, tmpX As Integer
                    If InStr(tmpb, tmpA) Then
                        For tmpX = InStr(tmpb, tmpA) To Len(tmpb) Step 1
                            If Mid(tmpb, tmpX, 1) = "," Then
                                tmp1 = tmpX
                                Exit For
                            End If
                        Next
                        For tmpX = InStr(tmpb, tmpA) + 1 To 1 Step -1
                            If Mid(tmpb, tmpX, 1) = "|" Then
                                tmp2 = tmpX
                                Exit For
                            End If
                        Next
                        If tmp2 > 0 Then
                            For tmpX = tmp2 To 1 Step -1
                                If Mid(tmpb, tmpX, 1) = "," Then
                                    tmp3 = tmpX
                                    Exit For
                                End If
                            Next
                            tmpc = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3), "", 1, 1)
                            If InStr(tmpc, "|") Then
                                MainProgram.MapData_DRTEM = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3) + ",", "")
                                If Mid(MainProgram.MapData_DRTEM, 1, 1) = "," Then
                                    MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 2, Len(MainProgram.MapData_DRTEM))
                                End If
                                If Mid(MainProgram.MapData_DRTEM, Len(MainProgram.MapData_DRTEM), 1) = "," Then
                                    MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 1, Len(MainProgram.MapData_DRTEM) - 1)
                                End If
                            Else
                                MainProgram.MapData_DRTEM = ""
                            End If
                            MainProgram.SND("/gYou sacrifice " + CorpseString + ", destroying all evidence.")
                            SaveTheSector()
                        End If
                    End If
                End If
            End If
        Next
    End Sub
    Private Sub CMD_rest(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            MainProgram.User_Resting = True
            MainProgram.SND("/gYou sit down and rest.")
            MainProgram.User_RestState = "/GResting"
        Else
            MainProgram.SND("/gYou are already resting, try standing up.")
        End If
    End Sub
    Private Sub CMD_sleep(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            MainProgram.User_Resting = True
            MainProgram.User_Sleeping = True
            MainProgram.User_RestState = "/GSleeping"
            MainProgram.SND("/gYou lay down and fall asleep.")
        ElseIf MainProgram.User_Resting = True And MainProgram.User_Sleeping = False Then
            MainProgram.User_Sleeping = True
            MainProgram.User_RestState = "/GSleeping"
            MainProgram.SND("/gYou lay all the way down and fall asleep.")
        Else
            MainProgram.SND("/gYou are already resting, try standing up.")
        End If
    End Sub
    Private Sub CMD_wakeup(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = True And MainProgram.User_Sleeping = True Then
            MainProgram.SND("/gYou wake up and stay rested on the ground.")
            MainProgram.User_RestState = "/GResting"
            MainProgram.User_Sleeping = False
        ElseIf MainProgram.User_Resting = True And MainProgram.User_Sleeping = False Then
            MainProgram.SND("/gYou are already resting, try standing up.")
        Else
            MainProgram.SND("/gYou aren't asleep.")
        End If
    End Sub
    Private Sub CMD_standup(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = True And MainProgram.User_Sleeping = False Then
            MainProgram.User_Resting = False
            MainProgram.User_RestState = "/YStanding"
            MainProgram.SND("/gYou stand up.")
        ElseIf MainProgram.User_Resting = True And MainProgram.User_Sleeping = True Then
            MainProgram.User_Sleeping = False
            MainProgram.User_Resting = False
            MainProgram.User_RestState = "/YStanding"
            MainProgram.SND("/gYou wake up and stand.")
        Else
            MainProgram.SND("/gYou are already standing, try sitting down.")
        End If
    End Sub
    Private Sub CMD_sitdown(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If MainProgram.User_Resting = False Then
            MainProgram.User_Resting = True
            MainProgram.User_RestState = "/GResting"
            MainProgram.SND("/gYou sit down and rest.")
        Else
            MainProgram.SND("/gYou are already resting, try standing up.")
        End If
    End Sub
    Private Sub CMD_proficiencies(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /C" + MainProgram.User_Class + " Proficiencies")
        MainProgram.SND("/c***********************************************")
        Dim tmpx As Short
        For tmpx = 0 To 12 Step 1
            If MainProgram.User_Proficiency(tmpx) <> "" Then
                MainProgram.SND("/c* " + MainProgram.User_Proficiency(tmpx) + ": /z" + MainProgram.User_ProficiencyDesc(tmpx))
            Else
                Exit For
            End If
        Next
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_spells(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /C" + MainProgram.User_Class + " Abilities")
        MainProgram.SND("/c***********************************************")
        MainProgram.SND("/c* /CLevel   mainprogram.Ability Name                 Learned")
        MainProgram.SND("/c*/C**********************************************")
        Dim tmpx As Short
        Dim tmpa As String
        For tmpx = 0 To 50 Step 1
            If MainProgram.AbilityName(tmpx) <> "" Then
                If MainProgram.AbilityLevel(tmpx) < 8 Then
                    If MainProgram.AbilityLevel(tmpx) > MainProgram.User_Level Then
                        tmpa = "/c*     /z" + LTrim(Str(MainProgram.AbilityLevel(tmpx))) + "   " + MainProgram.AbilityName(tmpx)
                        MainProgram.SND(MainProgram.AddSpace(tmpa, 42) + LTrim(Str(MainProgram.AbilityLearned(tmpx))) + "%")
                    Else
                        tmpa = "/c*     " + LTrim(Str(MainProgram.AbilityLevel(tmpx))) + "   " + MainProgram.AbilityName(tmpx)
                        MainProgram.SND(MainProgram.AddSpace(tmpa, 40) + LTrim(Str(MainProgram.AbilityLearned(tmpx))) + "%")
                    End If
                ElseIf MainProgram.AbilityLevel(tmpx) > 99 Then
                    If MainProgram.AbilityLevel(tmpx) > MainProgram.User_Level Then
                        tmpa = "/c*   /z" + LTrim(Str(MainProgram.AbilityLevel(tmpx))) + "   " + MainProgram.AbilityName(tmpx)
                        MainProgram.SND(MainProgram.AddSpace(tmpa, 42) + LTrim(Str(MainProgram.AbilityLearned(tmpx))) + "%")
                    Else
                        tmpa = "/c*   " + LTrim(Str(MainProgram.AbilityLevel(tmpx))) + "   " + MainProgram.AbilityName(tmpx)
                        MainProgram.SND(MainProgram.AddSpace(tmpa, 40) + LTrim(Str(MainProgram.AbilityLearned(tmpx))) + "%")
                    End If
                Else
                    If MainProgram.AbilityLevel(tmpx) > MainProgram.User_Level Then
                        tmpa = "/c*    /z" + LTrim(Str(MainProgram.AbilityLevel(tmpx))) + "   " + MainProgram.AbilityName(tmpx)
                        MainProgram.SND(MainProgram.AddSpace(tmpa, 42) + LTrim(Str(MainProgram.AbilityLearned(tmpx))) + "%")
                    Else
                        tmpa = "/c*    " + LTrim(Str(MainProgram.AbilityLevel(tmpx))) + "   " + MainProgram.AbilityName(tmpx)
                        MainProgram.SND(MainProgram.AddSpace(tmpa, 40) + LTrim(Str(MainProgram.AbilityLearned(tmpx))) + "%")
                    End If
                End If
            End If
        Next
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_weather(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim theseason As String = ""
        If MainProgram.Serverdatemonth = "Turn of Ritkus" Then
            theseason = "Spring"
        ElseIf MainProgram.Serverdatemonth = "Lythantos' Breath" Then
            theseason = "Spring"
        ElseIf MainProgram.Serverdatemonth = "The Shaded Aveo" Then
            theseason = "Summer"
        ElseIf MainProgram.Serverdatemonth = "The Burning Oeva" Then
            theseason = "Summer"
        ElseIf MainProgram.Serverdatemonth = "The Dying Flower" Then
            theseason = "Fall"
        ElseIf MainProgram.Serverdatemonth = "Roahn's Becoming" Then
            theseason = "Fall"
        ElseIf MainProgram.Serverdatemonth = "Falling Leaf" Then
            theseason = "Fall"
        ElseIf MainProgram.Serverdatemonth = "Winterblight" Then
            theseason = "Winter"
        ElseIf MainProgram.Serverdatemonth = "Changing Tide" Then
            theseason = "Winter"
        ElseIf MainProgram.Serverdatemonth = "Mahro's Blessing" Then
            theseason = "Spring"
        ElseIf MainProgram.Serverdatemonth = "Ettphemones Return" Then
            theseason = "Spring"
        End If
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* Province   :/z " + MainProgram.UserLocation_ProvinceString)
        MainProgram.SND("/c* Area       :/z " + MainProgram.UserLocation_AreaString)
        MainProgram.SND("/c* Map        :/z " + MainProgram.UserLocation_MapString)
        MainProgram.SND("/c* Sector     :/z " + MainProgram.UserLocation_SectorString)
        MainProgram.SND("/c* Environment:/z " + MainProgram.MapData_EnvironString)
        MainProgram.SND("/c***********************************************")
        MainProgram.SND("/c* Current season      :/z " + theseason)
        MainProgram.SND("/c* Current month       :/z " + MainProgram.Serverdatemonth)
        MainProgram.SND("/c* Current weather     :/z " + MainProgram.MapData_CurWeather)
        MainProgram.SND("/c* Current temperature :/z " + MainProgram.MapData_CurTemperature)
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_list(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim FoundIt As Boolean = False
        If InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))) Then
            Dim tmp0 As Short, tmp1 As Short, tmp2 As Short, tmp3 As Short, tmp4 As Short = 0, tmp5 As Short, startpos As Short, tmp00 As Short
            Dim tmpA As String, tmpB As String, tmpC As String = "", tmpD As String = ""
            Dim templookstr As Short = InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = templookstr To Len(MainProgram.MapData_CurrentMobs) Step 1
                If Mid(MainProgram.MapData_CurrentMobs, tmp0, 1) = "[" Then
                    For tmp1 = tmp0 To Len(MainProgram.MapData_CurrentMobs) Step 1
                        If Mid(MainProgram.MapData_CurrentMobs, tmp1, 1) = "]" Then
                            tmp1 = tmp0 + 2
                            tmpA = MainProgram.MapData_CurrentMobs
                            For tmp2 = tmp1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "[" Then
                                    Exit For
                                End If
                            Next
                            For tmp3 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp3, 1) = "[" Then
                                    tmp4 += 1
                                End If
                                If tmp3 = tmp2 Then
                                    Exit For
                                End If
                            Next
                            tmp4 -= 1
                            tmp4 /= 2
                            tmpB = "," + MainProgram.MapData_CCHAR + ","
                            If tmp4 = 0 Then
                                For tmp3 = 1 To Len(tmpB) Step 1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        LoadMob(Mid(tmpB, 2, tmp3 - 2))
                                        tmpD = "Found"
                                        Exit For
                                    End If
                                Next
                            End If
                            For tmp3 = 1 To Len(tmpB) Step 1
                                If Mid(tmpB, tmp3, 1) = "," Then
                                    tmp5 += 1
                                End If
                                If tmp5 = tmp4 Then
                                    tmpC = "Found"
                                    startpos = tmp3
                                End If
                                If tmpC = "Found" And tmp5 > tmp4 Then
                                    For tmp00 = tmp3 To Len(tmpB) Step 1
                                        If Mid(tmpB, tmp00, 1) = "." Then
                                            LoadMob(Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2))
                                            tmpD = "Found"
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                            tmp5 = 0
                            If tmpD <> "Found" Then
                                For tmp3 = Len(tmpB) To 1 Step -1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        tmp00 = tmp3
                                    End If
                                    If Mid(tmpB, tmp3, 1) = "," Then
                                        If tmp5 <= 0 Then
                                            tmp5 += 1
                                        Else
                                            startpos = tmp3
                                            LoadMob(Mid(tmpB, startpos + 1, tmp00 - startpos - 1))
                                            Exit For
                                        End If
                                    End If
                                Next
                            End If
                            FoundIt = True
                            Exit For
                        End If
                    Next
                    Exit For
                End If
            Next
        ElseIf InStr(LCase(MainProgram.MapData_CurrentProps), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))) Then 'looks to see if there are props
            'that will allow the MainProgram.User to buy from them. It's not always a 100% necessary for the player to purchase from
            'npcs. However at this time, because it's not supported in clay, this is unused code.
            Dim tmp0 As Short, tmp1 As Short, tmp2 As Short, tmp3 As Short, tmp4 As Short = 0, tmp5 As Short, startpos As Short, tmp00 As Short
            Dim tmpA As String, tmpB As String, tmpC As String = "", tmpD As String = ""
            Dim templookstr As Short = InStr(LCase(MainProgram.MapData_CurrentProps), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = templookstr To Len(MainProgram.MapData_CurrentProps) Step 1
                If Mid(MainProgram.MapData_CurrentProps, tmp0, 1) = "[" Then
                    For tmp1 = tmp0 To Len(MainProgram.MapData_CurrentProps) Step 1
                        If Mid(MainProgram.MapData_CurrentProps, tmp1, 1) = "]" Then
                            tmp1 = tmp0 + 2
                            tmpA = MainProgram.MapData_CurrentProps
                            For tmp2 = tmp1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "[" Then
                                    Exit For
                                End If
                            Next
                            For tmp3 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp3, 1) = "[" Then
                                    tmp4 += 1
                                End If
                                If tmp3 = tmp2 Then
                                    Exit For
                                End If
                            Next
                            tmp4 -= 1
                            tmp4 /= 2
                            tmpB = "," + MainProgram.MapData_CCHAR + ","
                            If tmp4 = 0 Then
                                For tmp3 = 1 To Len(tmpB) Step 1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        LoadMob(Mid(tmpB, 2, tmp3 - 2))
                                        tmpD = "Found"
                                        Exit For
                                    End If
                                Next
                            End If
                            For tmp3 = 1 To Len(tmpB) Step 1
                                If Mid(tmpB, tmp3, 1) = "," Then
                                    tmp5 += 1
                                End If
                                If tmp5 = tmp4 Then
                                    tmpC = "Found"
                                    startpos = tmp3
                                End If
                                If tmpC = "Found" And tmp5 > tmp4 Then
                                    For tmp00 = tmp3 To Len(tmpB) Step 1
                                        If Mid(tmpB, tmp00, 1) = "." Then
                                            LoadMob(Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2))
                                            tmpD = "Found"
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                            tmp5 = 0
                            If tmpD <> "Found" Then
                                For tmp3 = Len(tmpB) To 1 Step -1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        tmp00 = tmp3
                                    End If
                                    If Mid(tmpB, tmp3, 1) = "," Then
                                        If tmp5 <= 0 Then
                                            tmp5 += 1
                                        Else
                                            startpos = tmp3
                                            LoadMob(Mid(tmpB, startpos + 1, tmp00 - startpos - 1))
                                            Exit For
                                        End If
                                    End If
                                Next
                            End If
                            FoundIt = True
                            Exit For
                        End If
                    Next
                    Exit For
                End If
            Next
        Else
            MainProgram.SND("/W" + Mid(txt, 5, Len(txt)) + " is not currently here.")
        End If
        If FoundIt = True Then
            If MainProgram.MobData_Mer = True Then
                Dim CurMerchantVNum As Short = 0
                If MainProgram.MobData_Mer_SellsInventory = True Then
                    If MainProgram.MobData_DROP_static1 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_static1))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.ItemData_VIRID
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_static2 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_static2))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.ItemData_VIRID
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_static3 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_static3))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.ItemData_VIRID
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_static4 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_static4))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.ItemData_VIRID
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_static5 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_static5))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.ItemData_VIRID
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_dynamic1 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_dynamic1))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_dynamic2 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_dynamic2))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_dynamic3 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_dynamic3))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_dynamic4 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_dynamic4))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                    If MainProgram.MobData_DROP_dynamic5 <> "0" Then
                        MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_DROP_dynamic5))
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    End If
                End If
                If MainProgram.MobData_Mer_SellsWeapons = True Then
                    Dim TheRandom As New Random
                    Dim WeaponNumber As Short = TheRandom.Next(1, 5)
                    Dim tmp0 As Short
                    For tmp0 = 1 To WeaponNumber Step 1
                        Try 'currently still in test mode, try and catch will be erased once it's fully stable.
                            MainProgram.SND(MainProgram.FormatVendorItem("[1,1,1,1,1,1,1,?,?,?,?,?,?]"))
                        Catch exception As System.Exception
                            MainProgram.SND("/RERROR : 1680 - Format Item Error @ Generate")
                            MainProgram.SND("/YError suppressed and resolved successfully. Please report this.")
                            MainProgram.SND("/y" + exception.ToString)
                        End Try
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    Next
                End If
                If MainProgram.MobData_Mer_SellsArmor = True Then
                    Dim TheRandom As New Random
                    Dim ArmorNumber As Short = TheRandom.Next(1, 5)
                    Dim tmp0 As Short
                    For tmp0 = 1 To ArmorNumber Step 1
                        Try 'currently still in test mode, try and catch will be erased once it's fully stable.
                            MainProgram.SND(MainProgram.FormatVendorItem("[2,1,1,1,1,1,1,?,?,?,?,?,?]"))
                        Catch exception As System.Exception
                            MainProgram.SND("/RERROR : 1680 - Format Item Error @ Generate")
                            MainProgram.SND("/YError suppressed and resolved successfully. Please report this.")
                            MainProgram.SND("/y" + exception.ToString)
                        End Try
                        MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = MainProgram.CustumItemDataLastVNUM
                        MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = MainProgram.ItemData_ITEMN
                        CurMerchantVNum += 1
                    Next
                End If
                If MainProgram.MobData_Mer_SellsMisc = True Then
                    'code needs to be finished first
                    'SND(mainprogram.FormatVendorItem("[3,1,1,1,1,?]"))
                End If
                For CurMerchantVNum = CurMerchantVNum To 24 Step 1
                    MainProgram.MobData_Mer_ListVNUM(CurMerchantVNum) = ""
                    MainProgram.MobData_Mer_ListCODE(CurMerchantVNum) = ""
                Next
                MainProgram.State = "Shopping"
                MainProgram.SND("/w" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + "/gSure have a look, anything interesting " + MainProgram.User_Name + "?/G" + Chr(34))
                MainProgram.SND("/c[Options:/G list/c,/G buy itemname/c, /Gexamine itemname/c,/G inventory/c,/G sell itemname/c,/G done/c.] Weight Carried: " + LTrim(Str(MainProgram.User_WeightCarried)) + "\" + LTrim(Str(MainProgram.User_WeightCarriedMax)))
            Else
                MainProgram.SND("/W" + MainProgram.MobData_MNAME + " doesn't look like a merchant.")
            End If
        End If
    End Sub
    Private Sub CMD_look(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim testpdesc As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If testpdesc = Mid("self", 1, Len(testpdesc)) Then
            If MainProgram.User_Description <> "" Then
                MainProgram.SND(MainProgram.User_Description)
            Else
                MainProgram.SND("/zYou don't see anything special about yourself.")
            End If
            Exit Sub
        End If
        If InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))) Then
            Dim tmp0 As Short, tmp1 As Short, tmp2 As Short, tmp3 As Short, tmp4 As Short = 0, tmp5 As Short, startpos As Short, tmp00 As Short
            Dim tmpA As String, tmpB As String, tmpC As String = "", tmpD As String = ""
            Dim templookstr As Short = InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = templookstr To Len(MainProgram.MapData_CurrentMobs) Step 1
                If Mid(MainProgram.MapData_CurrentMobs, tmp0, 1) = "[" Then
                    For tmp1 = tmp0 To Len(MainProgram.MapData_CurrentMobs) Step 1
                        If Mid(MainProgram.MapData_CurrentMobs, tmp1, 1) = "]" Then
                            tmp1 = tmp0 + 2
                            tmpA = MainProgram.MapData_CurrentMobs
                            For tmp2 = tmp1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "[" Then
                                    Exit For
                                End If
                            Next
                            For tmp3 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp3, 1) = "[" Then
                                    tmp4 += 1
                                End If
                                If tmp3 = tmp2 Then
                                    Exit For
                                End If
                            Next
                            tmp4 -= 1
                            tmp4 /= 2
                            tmpB = "," + MainProgram.MapData_CCHAR + ","
                            If tmp4 = 0 Then
                                For tmp3 = 1 To Len(tmpB) Step 1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        LoadMob(Mid(tmpB, 2, tmp3 - 2))
                                        tmpD = "Found"
                                        Exit For
                                    End If
                                Next
                            End If
                            For tmp3 = 1 To Len(tmpB) Step 1
                                If Mid(tmpB, tmp3, 1) = "," Then
                                    tmp5 += 1
                                End If
                                If tmp5 = tmp4 Then
                                    tmpC = "Found"
                                    startpos = tmp3
                                End If
                                If tmpC = "Found" And tmp5 > tmp4 Then
                                    For tmp00 = tmp3 To Len(tmpB) Step 1
                                        If Mid(tmpB, tmp00, 1) = "." Then
                                            LoadMob(Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2))
                                            tmpD = "Found"
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                            tmp5 = 0
                            If tmpD <> "Found" Then
                                For tmp3 = Len(tmpB) To 1 Step -1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        tmp00 = tmp3
                                    End If
                                    If Mid(tmpB, tmp3, 1) = "," Then
                                        If tmp5 <= 0 Then
                                            tmp5 += 1
                                        Else
                                            startpos = tmp3
                                            LoadMob(Mid(tmpB, startpos + 1, tmp00 - startpos - 1))
                                            Exit For
                                        End If
                                    End If
                                Next
                            End If
                            MainProgram.SND("/z" + MainProgram.MobData_LDESC)
                            Exit For
                        End If
                    Next
                    Exit For
                End If
            Next
        ElseIf InStr(LCase(MainProgram.MapData_CurrentProps), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))) Then
            Dim tmp0 As Short, tmp1 As Short, tmp2 As Short, tmp3 As Short, tmp4 As Short = 0, tmp5 As Short, startpos As Short, tmp00 As Short
            Dim tmpA As String, tmpB As String, tmpC As String = "", tmpD As String = ""
            Dim templookstr As Short = InStr(LCase(MainProgram.MapData_CurrentProps), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = templookstr To Len(MainProgram.MapData_CurrentProps) Step 1
                If Mid(MainProgram.MapData_CurrentProps, tmp0, 1) = "[" Then
                    For tmp1 = tmp0 To Len(MainProgram.MapData_CurrentProps) Step 1
                        If Mid(MainProgram.MapData_CurrentProps, tmp1, 1) = "]" Then
                            tmp1 = tmp0 + 2
                            tmpA = MainProgram.MapData_CurrentProps
                            For tmp2 = tmp1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "[" Then
                                    Exit For
                                End If
                            Next
                            For tmp3 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp3, 1) = "[" Then
                                    tmp4 += 1
                                End If
                                If tmp3 = tmp2 Then
                                    Exit For
                                End If
                            Next
                            tmp4 -= 1
                            tmp4 /= 2
                            tmpB = "," + MainProgram.MapData_CCHAR + ","
                            If tmp4 = 0 Then
                                For tmp3 = 1 To Len(tmpB) Step 1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        LoadMob(Mid(tmpB, 2, tmp3 - 2))
                                        tmpD = "Found"
                                        Exit For
                                    End If
                                Next
                            End If
                            For tmp3 = 1 To Len(tmpB) Step 1
                                If Mid(tmpB, tmp3, 1) = "," Then
                                    tmp5 += 1
                                End If
                                If tmp5 = tmp4 Then
                                    tmpC = "Found"
                                    startpos = tmp3
                                End If
                                If tmpC = "Found" And tmp5 > tmp4 Then
                                    For tmp00 = tmp3 To Len(tmpB) Step 1
                                        If Mid(tmpB, tmp00, 1) = "." Then
                                            LoadMob(Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2))
                                            tmpD = "Found"
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                            tmp5 = 0
                            If tmpD <> "Found" Then
                                For tmp3 = Len(tmpB) To 1 Step -1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        tmp00 = tmp3
                                    End If
                                    If Mid(tmpB, tmp3, 1) = "," Then
                                        If tmp5 <= 0 Then
                                            tmp5 += 1
                                        Else
                                            startpos = tmp3
                                            LoadMob(Mid(tmpB, startpos + 1, tmp00 - startpos - 1))
                                            Exit For
                                        End If
                                    End If
                                Next
                            End If
                            MainProgram.SND("/z" + MainProgram.ItemData_LOOKD)
                            Exit For
                        End If
                    Next
                    Exit For
                End If
            Next
        Else
            MainProgram.SND("/W" + Mid(txt, 5, Len(txt)) + " is not currently here.")
        End If
    End Sub
    Private Sub CMD_talk(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim hideintro As Boolean = False
        If InStr(txt, "!@n4th4ni3l@!") Then
            txt = Replace(txt, "!@n4th4ni3l@!", "")
            hideintro = True
        Else
            MainProgram.StateOption(0) = ""
            MainProgram.StateOption(1) = ""
            MainProgram.StateOption(2) = ""
            MainProgram.StateOption(3) = ""
            MainProgram.StateOption(4) = ""
        End If
        If InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))) Then
            Dim tmp0 As Short, tmp1 As Short, tmp2 As Short, tmp3 As Short, tmp4 As Short = 0, tmp5 As Short, startpos As Short, tmp00 As Short
            Dim tmpA As String, tmpB As String, tmpC As String = "", tmpD As String = ""
            Dim templookstr As Short = InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = templookstr To Len(MainProgram.MapData_CurrentMobs) Step 1
                If Mid(MainProgram.MapData_CurrentMobs, tmp0, 1) = "[" Then
                    For tmp1 = tmp0 To Len(MainProgram.MapData_CurrentMobs) Step 1
                        If Mid(MainProgram.MapData_CurrentMobs, tmp1, 1) = "]" Then
                            tmp1 = tmp0 + 2
                            tmpA = MainProgram.MapData_CurrentMobs
                            For tmp2 = tmp1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "[" Then
                                    Exit For
                                End If
                            Next
                            For tmp3 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp3, 1) = "[" Then
                                    tmp4 += 1
                                End If
                                If tmp3 = tmp2 Then
                                    Exit For
                                End If
                            Next
                            tmp4 -= 1
                            tmp4 /= 2
                            tmpB = "," + MainProgram.MapData_CCHAR + ","
                            If tmp4 = 0 Then
                                For tmp3 = 1 To Len(tmpB) Step 1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        If hideintro = False Then
                                            LoadMob(Mid(tmpB, 2, tmp3 - 2))
                                            MainProgram.FirstScriptLoad = True
                                        End If
                                        tmpD = "Found"
                                        Exit For
                                    End If
                                Next
                            End If
                            For tmp3 = 1 To Len(tmpB) Step 1
                                If Mid(tmpB, tmp3, 1) = "," Then
                                    tmp5 += 1
                                End If
                                If tmp5 = tmp4 Then
                                    tmpC = "Found"
                                    startpos = tmp3
                                End If
                                If tmpC = "Found" And tmp5 > tmp4 Then
                                    For tmp00 = tmp3 To Len(tmpB) Step 1
                                        If Mid(tmpB, tmp00, 1) = "." Then
                                            If hideintro = False Then
                                                LoadMob(Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2))
                                                MainProgram.FirstScriptLoad = True
                                            End If
                                            tmpD = "Found"
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                            tmp5 = 0
                            If tmpD <> "Found" Then
                                For tmp3 = Len(tmpB) To 1 Step -1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        tmp00 = tmp3
                                    End If
                                    If Mid(tmpB, tmp3, 1) = "," Then
                                        If tmp5 <= 0 Then
                                            tmp5 += 1
                                        Else
                                            startpos = tmp3
                                            If hideintro = False Then
                                                LoadMob(Mid(tmpB, startpos + 1, tmp00 - startpos - 1))
                                                MainProgram.FirstScriptLoad = True
                                            End If
                                            Exit For
                                        End If
                                    End If
                                Next
                            End If
                            For tmp5 = 1 To Len(MainProgram.MobData_SCRIT) Step 1
                                If Mid(MainProgram.MobData_SCRIT, tmp5, 1) = "." And hideintro = False Then 'only load when you first talk to mainprogram.mob
                                    LoadScript.LoadScript(Mid(MainProgram.MobData_SCRIT, 1, tmp5 - 1))
                                    Exit For
                                ElseIf hideintro = True Then
                                    Exit For
                                End If
                            Next
                            If InStr(MainProgram.ScriptData_INTRO, "[EXIT]") Then 'this only works if the target has an exit flag in his intro
                                If hideintro = False Then 'this will close the conversation and return to open MainProgram.State
                                    If InStr(MainProgram.ScriptData_INTRO, "<!>") Or InStr(MainProgram.ScriptData_INTRO, "<P>") Then
                                        Dim tmp6 As Integer, tmpE As String = Replace(MainProgram.ScriptData_INTRO + "<X>", "[EXIT]", ""), IsEmote As Boolean = False, TheString As String = ""
                                        Dim CountDown As Short = 0
                                        For tmp6 = 1 To Len(tmpE) Step 1
                                            If Mid(tmpE, tmp6, 3) = "<!>" Then
                                                CountDown = 3
                                                IsEmote = True
                                            ElseIf Mid(tmpE, tmp6, 3) = "<P>" Then
                                                CountDown = 3
                                                If IsEmote = True Then
                                                    MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                                Else
                                                    MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + TheString + Chr(34))
                                                End If
                                                TheString = ""
                                                IsEmote = False
                                            ElseIf Mid(tmpE, tmp6, 3) = "<X>" Then
                                                CountDown = 3
                                                If IsEmote = True Then
                                                    MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                                Else
                                                    MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                                End If
                                                Exit For
                                            End If
                                            If CountDown > 0 Then
                                                CountDown -= 1
                                            Else
                                                TheString += Mid(tmpE, tmp6, 1)
                                            End If
                                        Next
                                    Else
                                        MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + Replace(MainProgram.ScriptData_INTRO, "[EXIT]", "") + Chr(34))
                                    End If
                                End If
                            Else 'you are now entering closed MainProgram.State, determine flags for the conversation options
                                If hideintro = False Then
                                    If InStr(MainProgram.ScriptData_INTRO, "<!>") Or InStr(MainProgram.ScriptData_INTRO, "<P>") Then
                                        Dim tmp6 As Integer, tmpE As String = Replace(MainProgram.ScriptData_INTRO + "<X>", "[EXIT]", ""), IsEmote As Boolean = False, TheString As String = ""
                                        Dim CountDown As Short = 0
                                        For tmp6 = 1 To Len(tmpE) Step 1
                                            If Mid(tmpE, tmp6, 3) = "<!>" Then
                                                CountDown = 3
                                                IsEmote = True
                                            ElseIf Mid(tmpE, tmp6, 3) = "<P>" Then
                                                CountDown = 3
                                                If IsEmote = True Then
                                                    MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                                Else
                                                    MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + TheString + Chr(34))
                                                End If
                                                TheString = ""
                                                IsEmote = False
                                            ElseIf Mid(tmpE, tmp6, 3) = "<X>" Then
                                                CountDown = 3
                                                If IsEmote = True Then
                                                    MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                                Else
                                                    MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                                End If
                                                Exit For
                                            End If
                                            If CountDown > 0 Then
                                                CountDown -= 1
                                            Else
                                                TheString += Mid(tmpE, tmp6, 1)
                                            End If
                                        Next
                                    Else
                                        MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + Replace(MainProgram.ScriptData_INTRO, "[EXIT]", "") + Chr(34))
                                    End If
                                End If
                                If InStr(MainProgram.ScriptData_OPTIONS, ",5.") Then
                                    MainProgram.ShowConversationOptions(5)
                                ElseIf InStr(MainProgram.ScriptData_OPTIONS, ",4.") Then
                                    MainProgram.ShowConversationOptions(4)
                                ElseIf InStr(MainProgram.ScriptData_OPTIONS, ",3.") Then
                                    MainProgram.ShowConversationOptions(3)
                                ElseIf InStr(MainProgram.ScriptData_OPTIONS, ",2.") Then
                                    MainProgram.ShowConversationOptions(2)
                                ElseIf InStr(MainProgram.ScriptData_OPTIONS, "1.") Then
                                    MainProgram.ShowConversationOptions(1)
                                Else
                                    MainProgram.SND("/RMOBILE DOES NOT HAVE OPTIONS!! ERROR!")
                                End If
                            End If
                            Exit For
                        End If
                    Next
                    Exit For
                End If
            Next
        Else
            MainProgram.SND(Mid(txt, 5, Len(txt)) + " is not currently here.")
        End If
    End Sub
    Private Sub CMD_kill(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))) And RandomMap = False Then
            Dim tmp0 As Short, tmp1 As Short, tmp2 As Short, tmp3 As Short, tmp4 As Short = 0, tmp5 As Short, startpos As Short, tmp00 As Short
            Dim tmpA As String, tmpB As String, tmpC As String = "", tmpD As String = ""
            Dim templookstr As Short = InStr(LCase(MainProgram.MapData_CurrentMobs), LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            For tmp0 = templookstr To Len(MainProgram.MapData_CurrentMobs) Step 1
                If Mid(MainProgram.MapData_CurrentMobs, tmp0, 1) = "[" Then
                    For tmp1 = tmp0 To Len(MainProgram.MapData_CurrentMobs) Step 1
                        If Mid(MainProgram.MapData_CurrentMobs, tmp1, 1) = "]" Then
                            tmp1 = tmp0 + 2
                            tmpA = MainProgram.MapData_CurrentMobs
                            For tmp2 = tmp1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp0, 1) = "[" Then
                                    Exit For
                                End If
                            Next
                            For tmp3 = 1 To Len(tmpA) Step 1
                                If Mid(tmpA, tmp3, 1) = "[" Then
                                    tmp4 += 1
                                End If
                                If tmp3 = tmp2 Then
                                    Exit For
                                End If
                            Next
                            tmp4 -= 1
                            tmp4 /= 2
                            tmpB = "," + MainProgram.MapData_CCHAR + ","
                            If tmp4 = 0 Then
                                For tmp3 = 1 To Len(tmpB) Step 1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        LoadMob(Mid(tmpB, 2, tmp3 - 2))
                                        MainProgram.MobData_VIRID = Mid(tmpB, 2, tmp3 - 2)
                                        tmpD = "Found"
                                        Exit For
                                    End If
                                Next
                            End If
                            For tmp3 = 1 To Len(tmpB) Step 1
                                If Mid(tmpB, tmp3, 1) = "," Then
                                    tmp5 += 1
                                End If
                                If tmp5 = tmp4 Then
                                    tmpC = "Found"
                                    startpos = tmp3
                                End If
                                If tmpC = "Found" And tmp5 > tmp4 Then
                                    For tmp00 = tmp3 To Len(tmpB) Step 1
                                        If Mid(tmpB, tmp00, 1) = "." Then
                                            LoadMob(Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2))
                                            MainProgram.MobData_VIRID = Mid(tmpB, tmp3 + 1, tmp00 - startpos - 2)
                                            tmpD = "Found"
                                            Exit For
                                        End If
                                    Next
                                    Exit For
                                End If
                            Next
                            tmp5 = 0
                            If tmpD <> "Found" Then
                                For tmp3 = Len(tmpB) To 1 Step -1
                                    If Mid(tmpB, tmp3, 1) = "." Then
                                        tmp00 = tmp3
                                    End If
                                    If Mid(tmpB, tmp3, 1) = "," Then
                                        If tmp5 <= 0 Then
                                            tmp5 += 1
                                        Else
                                            startpos = tmp3
                                            LoadMob(Mid(tmpB, startpos + 1, tmp00 - startpos - 1))
                                            MainProgram.MobData_VIRID = Mid(tmpB, startpos + 1, tmp00 - startpos - 1)
                                            Exit For
                                        End If
                                    End If
                                Next
                            End If
                            'Zombie creatures may be animated and assembled.
                            'Skeletal creatures may be animated but not reassembled.
                            'Phantoms are incorporeal creatures who may attack but only be attacked by magic, they may not be enslaved.
                            'Wraiths are skeletal creatures who are inhabited by phantoms, they may not be enslaved.
                            'Spectrals are immune to magic, may attack or be attacked, but not enslaved.
                            'Horrors are immune to all attacks, but will leave once all players are awake.
                            If MainProgram.MobData_ARCHE = "Standard" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Zombie" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Skeletal" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Spirit" Then
                                'Spirits are incorporeal creatures who may not attack or be attacked but may be enslaved by necromancers.
                                MainProgram.SND("/wThe spirit doesn't seem to notice you're there.")
                            ElseIf MainProgram.MobData_ARCHE = "Phantom" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Wraith" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Spectral" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Horror" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            ElseIf MainProgram.MobData_ARCHE = "Archon" Then
                                'Archons are immune to all attacks, and don't attack.
                                MainProgram.SND("/wYour hand becomes steady, resolute in avoiding dire circumstances.")
                                MainProgram.SNDWait("/g" + MainProgram.MobData_SHORT + " looks in your direction curious.", 15)
                            ElseIf MainProgram.MobData_ARCHE = "Unknown" Then
                                MainProgram.State = "Combat"
                                MainProgram.StartCombat = True
                            End If
                            Exit For
                        End If
                    Next
                    Exit For
                End If
            Next
        ElseIf RandomMap = True Then
            GenerateMap.Kill(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
        Else
            MainProgram.SND(Mid(txt, 5, Len(txt)) + " is not currently here.")
        End If
    End Sub
    Private Sub CMD_inventory(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmp0 As Integer
        MainProgram.SND("/gYou look within your bags...")
        MainProgram.SND("/W[IIIIIIIIII)Inventory(IIIIIIIIII]")
        For tmp0 = 0 To 39 Step 1
            If MainProgram.User_Inventory(tmp0) <> "" Then
                MainProgram.SND("/w " + MainProgram.User_Inventory(tmp0))
            End If
        Next
        MainProgram.SND("/W[IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII]")
    End Sub
    'unfinished
    Private Sub CMD_report(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.SND(MainProgram.OutputText)
    End Sub
    Private Sub CMD_languages()
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* Common   :/z " + LTrim(Str(MainProgram.User_Language_Common)) + "%")
        MainProgram.SND("/c* Narsik   :/z " + LTrim(Str(MainProgram.User_Language_Narsik)) + "%")
        MainProgram.SND("/c* Northern :/z " + LTrim(Str(MainProgram.User_Language_Northern)) + "%")
        MainProgram.SND("/c* Draconian:/z " + LTrim(Str(MainProgram.User_Language_Draconian)) + "%")
        MainProgram.SND("/c* Celestial:/z " + LTrim(Str(MainProgram.User_Language_Celestial)) + "%")
        MainProgram.SND("/c* Infernal :/z " + LTrim(Str(MainProgram.User_Language_Infernal)) + "%")
        MainProgram.SND("/c* Arcanic  :/z " + LTrim(Str(MainProgram.User_Language_Arcanic)) + "%")
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_score()
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND(MainProgram.AddSpace("/c* Name:/z " + MainProgram.CapitalizeEachWord(MainProgram.User_Name), 35) + "/cPassword:/z " + MainProgram.User_Password)
        MainProgram.SND("/c* Birthday:/z " + MainProgram.User_Birthday)
        MainProgram.SND(MainProgram.AddSpace("/c* Height:/z " + LTrim(MainProgram.User_Height), 40) + "/cSTR: /z" + LTrim(Str(MainProgram.User_Strengthmod)) + " /z(" + LTrim(Str(MainProgram.User_Strength)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z " + LTrim(MainProgram.User_Weight), 40) + "/cDEX: /z" + LTrim(Str(MainProgram.User_Dexteritymod)) + " /z(" + LTrim(Str(MainProgram.User_Dexterity)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Age:/z " + MainProgram.User_Age, 40) + "/cINT: /z" + LTrim(Str(MainProgram.User_Intelligencemod)) + " /z(" + LTrim(Str(MainProgram.User_Intelligence)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Level:/z " + LTrim(Str(MainProgram.User_Level)), 40) + "/cWIS: /z" + LTrim(Str(MainProgram.User_Wisdommod)) + " /z(" + LTrim(Str(MainProgram.User_Wisdom)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Sex:/z " + MainProgram.User_Gender, 40) + "/cCON: /z" + LTrim(Str(MainProgram.User_Constitutionmod)) + " /z(" + LTrim(Str(MainProgram.User_Constitution)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Race:/z " + MainProgram.User_Race, 40) + "/cCHA: /z" + LTrim(Str(MainProgram.User_Charismamod)) + " /z(" + LTrim(Str(MainProgram.User_Charisma)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Class:/z " + MainProgram.User_Class, 40) + "/cLUC: /z" + LTrim(Str(MainProgram.User_Luckmod)) + " /z(" + LTrim(Str(MainProgram.User_Luck)) + ")")
        MainProgram.SND(MainProgram.AddSpace("/c* Province:/z " + MainProgram.User_HomeProvince, 34) + "/cPractices: /z" + LTrim(Str(MainProgram.User_PracticePoints)))
        MainProgram.SND(MainProgram.AddSpace("/c* Rode:/z " + MainProgram.User_Rode, 37) + "/cTrains: /z" + LTrim(Str(MainProgram.User_TrainingPoints)))
        MainProgram.SND("/c***********************************************")
        MainProgram.SND(MainProgram.AddSpace("/c* Citizenship:/z " + MainProgram.User_Citizenship, 37) + "/cTemple: /z" + MainProgram.User_Temple)
        MainProgram.SND(MainProgram.AddSpace("/c* Loyalty:/z " + MainProgram.User_Loyalty, 32) + "/cTemple Rank: /z" + MainProgram.User_TempleRank)
        MainProgram.SND(MainProgram.AddSpace("/c* Tradesguild:/z " + MainProgram.User_Tradesguild, 39) + "/cClan:/z " + MainProgram.User_Clan)
        MainProgram.SND(MainProgram.AddSpace("/c* Tradesguild Rank:/z " + MainProgram.User_TradesguildRank, 34) + "/cClan Rank:/z " + MainProgram.User_ClanRank)
        MainProgram.SND("/c***********************************************")
        MainProgram.SND(MainProgram.AddSpace("/c* HP:/z " + MainProgram.AddSpace(MainProgram.User_CurHP, 5) + "\" + MainProgram.AddSpaceL(MainProgram.User_MaxHP, 5), 29) + "/cWeight Carried:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_WeightCarried)), 3) + "/" + MainProgram.AddSpaceL(LTrim(Str(MainProgram.User_WeightCarriedMax)), 3) + " Stones")
        MainProgram.SND(MainProgram.AddSpace("/c* WP:/z " + MainProgram.AddSpace(MainProgram.User_CurWP, 5) + "\" + MainProgram.AddSpaceL(MainProgram.User_MaxWP, 5), 30) + "/cItems Carried:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_ItemsCarried)), 3) + "/" + MainProgram.AddSpaceL(LTrim(Str(MainProgram.User_ItemsCarriedMax)), 3))
        MainProgram.SND("/c* SP:/z " + MainProgram.AddSpace(MainProgram.User_CurSP, 5) + "\" + MainProgram.AddSpaceL(MainProgram.User_MaxSP, 5))
        MainProgram.SND("/c* ")
        MainProgram.SND(MainProgram.AddSpace("/c* Bash    AC:/z " + LTrim(Str(MainProgram.User_BashAC)), 29) + "/cMoney:/z " + MainProgram.User_Sovern + " Sovern " + MainProgram.User_Dover + " Dover " + MainProgram.User_Vern + " Vern")
        MainProgram.SND(MainProgram.AddSpace("/c* Slash   AC:/z " + LTrim(Str(MainProgram.User_SlashAC)), 30) + "/cBank:/z " + MainProgram.User_BankSovern + " Sovern " + MainProgram.User_BankDover + " Dover " + MainProgram.User_BankVern + " Vern")
        MainProgram.SND("/c* Pierce  AC:/z " + LTrim(Str(MainProgram.User_PierceAC)))
        MainProgram.SND(MainProgram.AddSpace("/c* Fist    AC:/z " + LTrim(Str(MainProgram.User_FistAC)), 30) + MainProgram.User_RestedStateString)
        MainProgram.SND(MainProgram.AddSpace("/c* Exotic  AC:/z " + LTrim(Str(MainProgram.User_ExoticAC)), 30) + MainProgram.User_HungryString)
        MainProgram.SND(MainProgram.AddSpace("/c* Natural AC:/z " + LTrim(Str(MainProgram.User_NaturalAC)), 30) + MainProgram.User_ThirstyString)
        MainProgram.SND(MainProgram.AddSpace("/c* Total   AC:/z " + LTrim(Str(MainProgram.User_TotalAC)), 30) + MainProgram.User_RestState)
        MainProgram.SND("/c* ")
        MainProgram.SND("/c* Fire      Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Resistance_Fire)), 3) + "/c  Fire      Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Amplification_Fire)), 3) + "/c  SubFire   Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubResistance_Fire)), 3) + "/c  SubFire   Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubAmplification_Fire)), 3))
        MainProgram.SND("/c* Water     Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Resistance_Water)), 3) + "/c  Water     Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Amplification_Water)), 3) + "/c  SubWater  Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubResistance_Water)), 3) + "/c  SubWater  Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubAmplification_Water)), 3))
        MainProgram.SND("/c* Air       Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Resistance_Air)), 3) + "/c  Air       Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Amplification_Air)), 3) + "/c  SubAir    Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubResistance_Air)), 3) + "/c  SubAir    Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubAmplification_Air)), 3))
        MainProgram.SND("/c* Earth     Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Resistance_Earth)), 3) + "/c  Earth     Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Amplification_Earth)), 3) + "/c  SubEarth  Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubResistance_Earth)), 3) + "/c  SubEarth  Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubAmplification_Earth)), 3))
        MainProgram.SND("/c* Spirit    Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Resistance_Spirit)), 3) + "/c  Spirit    Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_Amplification_Spirit)), 3) + "/c  SubSpirit Res:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubResistance_Spirit)), 3) + "/c  SubSpirit Amp:/z " + MainProgram.AddSpace(LTrim(Str(MainProgram.User_SubAmplification_Spirit)), 3))
        MainProgram.SND("/c***********************************************")
        MainProgram.SND("/c* Other Commands: Languages, Equip, Abilities, Inventory")
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_equip()
        MainProgram.SND("/gYou stop and take a look at yourself...")
        MainProgram.SND("/W[IIIIIIIIII)Equipment(IIIIIIIIII]")
        If MainProgram.UserEquip_Head <> "Empty" Then MainProgram.SND("/W Head     /Z: " + MainProgram.UserEquip_Head) Else MainProgram.SND("/W Head     /Z:/z " + MainProgram.UserEquip_Head)
        If MainProgram.UserEquip_Neck <> "Empty" Then MainProgram.SND("/W Neck     /Z: " + MainProgram.UserEquip_Neck) Else MainProgram.SND("/W Neck     /Z:/z " + MainProgram.UserEquip_Neck)
        If MainProgram.UserEquip_Shoulders <> "Empty" Then MainProgram.SND("/W Shoulders/Z: " + MainProgram.UserEquip_Shoulders) Else MainProgram.SND("/W Shoulders/Z:/z " + MainProgram.UserEquip_Shoulders)
        If MainProgram.UserEquip_Arms <> "Empty" Then MainProgram.SND("/W Arms     /Z: " + MainProgram.UserEquip_Arms) Else MainProgram.SND("/W Arms     /Z:/z " + MainProgram.UserEquip_Arms)
        If MainProgram.UserEquip_Wrists <> "Empty" Then MainProgram.SND("/W Wrists   /Z: " + MainProgram.UserEquip_Wrists) Else MainProgram.SND("/W Wrists   /Z:/z " + MainProgram.UserEquip_Wrists)
        If MainProgram.UserEquip_Hands <> "Empty" Then MainProgram.SND("/W Hands    /Z: " + MainProgram.UserEquip_Hands) Else MainProgram.SND("/W Hands    /Z:/z " + MainProgram.UserEquip_Hands)
        If MainProgram.UserEquip_LFinger <> "Empty" Then MainProgram.SND("/W LFinger  /Z: " + MainProgram.UserEquip_LFinger) Else MainProgram.SND("/W LFinger  /Z:/z " + MainProgram.UserEquip_LFinger)
        If MainProgram.UserEquip_RFinger <> "Empty" Then MainProgram.SND("/W RFinger  /Z: " + MainProgram.UserEquip_RFinger) Else MainProgram.SND("/W RFinger  /Z:/z " + MainProgram.UserEquip_RFinger)
        If MainProgram.UserEquip_Chest <> "Empty" Then MainProgram.SND("/W Chest    /Z: " + MainProgram.UserEquip_Chest) Else MainProgram.SND("/W Chest    /Z:/z " + MainProgram.UserEquip_Chest)
        If MainProgram.UserEquip_Back <> "Empty" Then MainProgram.SND("/W Back     /Z: " + MainProgram.UserEquip_Back) Else MainProgram.SND("/W Back     /Z:/z " + MainProgram.UserEquip_Back)
        If MainProgram.UserEquip_Waist <> "Empty" Then MainProgram.SND("/W Belt     /Z: " + MainProgram.UserEquip_Waist) Else MainProgram.SND("/W Belt     /Z:/z " + MainProgram.UserEquip_Waist)
        If MainProgram.UserEquip_Legs <> "Empty" Then MainProgram.SND("/W Legs     /Z: " + MainProgram.UserEquip_Legs) Else MainProgram.SND("/W Legs     /Z:/z " + MainProgram.UserEquip_Legs)
        If MainProgram.UserEquip_Boots <> "Empty" Then MainProgram.SND("/W Boots    /Z: " + MainProgram.UserEquip_Boots) Else MainProgram.SND("/W Boots    /Z:/z " + MainProgram.UserEquip_Boots)
        If MainProgram.UserEquip_Mainhand <> "Empty" Then MainProgram.SND("/W Mainhand /Z: " + MainProgram.UserEquip_Mainhand) Else MainProgram.SND("/W Mainhand /Z:/z " + MainProgram.UserEquip_Mainhand)
        If MainProgram.UserEquip_Offhand <> "Empty" Then MainProgram.SND("/W Offhand  /Z: " + MainProgram.UserEquip_Offhand) Else MainProgram.SND("/W Offhand  /Z:/z " + MainProgram.UserEquip_Offhand)
        If MainProgram.UserEquip_Range <> "Empty" Then MainProgram.SND("/W Range    /Z: " + MainProgram.UserEquip_Range) Else MainProgram.SND("/W Range    /Z:/z " + MainProgram.UserEquip_Range)
        MainProgram.SND("/W[IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII]")
    End Sub
    Private Sub CMD_gm_summon(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If MainProgram.MapData_CCHAR <> "" Then
            MainProgram.MapData_CCHAR += "," + tmpa + ".Default"
            LoadMob(tmpa)
            MainProgram.MapData_CurrentMobs += MainProgram.MobData_SHORT
            SaveTheSector()
        Else
            MainProgram.MapData_CCHAR = tmpa + ".Default"
            LoadMob(tmpa)
            MainProgram.MapData_CurrentMobs += MainProgram.MobData_SHORT
            SaveTheSector()
        End If
        MainProgram.SND("/YSummoned mainprogram.mobile(/y" + tmpa + "/Y)")
        MainProgram.SND("/gWith a flash of light, " + MainProgram.MobData_SHORT + " appears.")
    End Sub
    Private Sub CMD_gm_gorandom(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If GenerateMap.RandomMap = False Then GenerateMap.RandomMap = True
        GenerateMap.MapCreated = False
        LoadSector.LoadSector("Random", False)
    End Sub
    Private Sub CMD_gm_gostart(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        If GenerateMap.RandomMap = True Then GenerateMap.RandomMap = False
        MainProgram.UserLocation_MapString = "RuinsOfVharmas"
        LoadSector.LoadSector("3", True, True)
    End Sub
    Private Sub CMD_dropall(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim Tempvar As Integer
        For Tempvar = 0 To 39 Step 1
            MainProgram.User_Inventory(Tempvar) = ""
            MainProgram.User_InventoryNUM(Tempvar) = "0"
        Next
        MainProgram.SND("/gYou drop everything you're carrying to the ground.")
    End Sub
    Private Sub CMD_removeall(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.AddItemHide = True
        If MainProgram.UserEquip_Head <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_HeadNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Head + "/g.")
            MainProgram.UserEquip_Head = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_HeadNUM)
            MainProgram.UserEquip_HeadNUM = "0"
        End If
        If MainProgram.UserEquip_Neck <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_NeckNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Neck + "/g.")
            MainProgram.UserEquip_Neck = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_NeckNUM)
            MainProgram.UserEquip_NeckNUM = "0"
        End If
        If MainProgram.UserEquip_Shoulders <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_ShouldersNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Shoulders + "/g.")
            MainProgram.UserEquip_Shoulders = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_ShouldersNUM)
            MainProgram.UserEquip_ShouldersNUM = "0"
        End If
        If MainProgram.UserEquip_Back <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_BackNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Back + "/g.")
            MainProgram.UserEquip_Back = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_BackNUM)
            MainProgram.UserEquip_BackNUM = "0"
        End If
        If MainProgram.UserEquip_Arms <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_ArmsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Arms + "/g.")
            MainProgram.UserEquip_Arms = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_ArmsNUM)
            MainProgram.UserEquip_ArmsNUM = "0"
        End If
        If MainProgram.UserEquip_Wrists <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_WristsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Wrists + "/g.")
            MainProgram.UserEquip_Wrists = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_WristsNUM)
            MainProgram.UserEquip_WristsNUM = "0"
        End If
        If MainProgram.UserEquip_Hands <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_HandsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Hands + "/g.")
            MainProgram.UserEquip_Hands = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_HandsNUM)
            MainProgram.UserEquip_HandsNUM = "0"
        End If
        If MainProgram.UserEquip_LFinger <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_LFingerNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_LFinger + "/g.")
            MainProgram.UserEquip_LFinger = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_LFingerNUM)
            MainProgram.UserEquip_LFingerNUM = "0"
        End If
        If MainProgram.UserEquip_RFinger <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_RFingerNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_RFinger + "/g.")
            MainProgram.UserEquip_RFinger = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_RFingerNUM)
            MainProgram.UserEquip_RFingerNUM = "0"
        End If
        If MainProgram.UserEquip_Chest <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_ChestNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Chest + "/g.")
            MainProgram.UserEquip_Chest = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_ChestNUM)
            MainProgram.UserEquip_ChestNUM = "0"
        End If
        If MainProgram.UserEquip_Waist <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_WaistNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Waist + "/g.")
            MainProgram.UserEquip_Waist = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_WaistNUM)
            MainProgram.UserEquip_WaistNUM = "0"
        End If
        If MainProgram.UserEquip_Legs <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_LegsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Legs + "/g.")
            MainProgram.UserEquip_Legs = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_LegsNUM)
            MainProgram.UserEquip_LegsNUM = "0"
        End If
        If MainProgram.UserEquip_Boots <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_BootsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Boots + "/g.")
            MainProgram.UserEquip_Boots = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_BootsNUM)
            MainProgram.UserEquip_BootsNUM = "0"
        End If
        If MainProgram.UserEquip_Mainhand <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_MainhandNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Mainhand + "/g.")
            MainProgram.UserEquip_Mainhand = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_MainhandNUM)
            MainProgram.UserEquip_MainhandNUM = "0"
        End If
        If MainProgram.UserEquip_Offhand <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_OffhandNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Offhand + "/g.")
            MainProgram.UserEquip_Offhand = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_OffhandNUM)
            MainProgram.UserEquip_OffhandNUM = "0"
        End If
        If MainProgram.UserEquip_Range <> "Empty" Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_RangeNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Range + "/g.")
            MainProgram.UserEquip_Range = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_RangeNUM)
            MainProgram.UserEquip_RangeNUM = "0"
        End If
        MainProgram.SND("/gYou successfully mainprogram.remove all of your armor and weapons.")
    End Sub
    Private Sub CMD_remove(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If InStr(LCase(MainProgram.UserEquip_Head), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_HeadNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Head + "/g.")
            MainProgram.UserEquip_Head = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_HeadNUM)
            MainProgram.UserEquip_HeadNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Neck), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_NeckNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Neck + "/g.")
            MainProgram.UserEquip_Neck = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_NeckNUM)
            MainProgram.UserEquip_NeckNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Shoulders), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_ShouldersNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Shoulders + "/g.")
            MainProgram.UserEquip_Shoulders = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_ShouldersNUM)
            MainProgram.UserEquip_ShouldersNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Back), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_BackNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Back + "/g.")
            MainProgram.UserEquip_Back = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_BackNUM)
            MainProgram.UserEquip_BackNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Arms), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_ArmsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Arms + "/g.")
            MainProgram.UserEquip_Arms = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_ArmsNUM)
            MainProgram.UserEquip_ArmsNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Wrists), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_WristsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Wrists + "/g.")
            MainProgram.UserEquip_Wrists = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_WristsNUM)
            MainProgram.UserEquip_WristsNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Hands), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_HandsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Hands + "/g.")
            MainProgram.UserEquip_Hands = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_HandsNUM)
            MainProgram.UserEquip_HandsNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_LFinger), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_LFingerNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_LFinger + "/g.")
            MainProgram.UserEquip_LFinger = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_LFingerNUM)
            MainProgram.UserEquip_LFingerNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_RFinger), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_RFingerNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_RFinger + "/g.")
            MainProgram.UserEquip_RFinger = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_RFingerNUM)
            MainProgram.UserEquip_RFingerNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Chest), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_ChestNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Chest + "/g.")
            MainProgram.UserEquip_Chest = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_ChestNUM)
            MainProgram.UserEquip_ChestNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Waist), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_WaistNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Waist + "/g.")
            MainProgram.SND(MainProgram.UserEquip_WaistNUM)
            MainProgram.UserEquip_Waist = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_WaistNUM)
            MainProgram.UserEquip_WaistNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Legs), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_LegsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Legs + "/g.")
            MainProgram.UserEquip_Legs = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_LegsNUM)
            MainProgram.UserEquip_LegsNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Boots), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_BootsNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Boots + "/g.")
            MainProgram.UserEquip_Boots = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_BootsNUM)
            MainProgram.UserEquip_BootsNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Mainhand), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_MainhandNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Mainhand + "/g.")
            MainProgram.UserEquip_Mainhand = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_MainhandNUM)
            MainProgram.UserEquip_MainhandNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Offhand), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_OffhandNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Offhand + "/g.")
            MainProgram.UserEquip_Offhand = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_OffhandNUM)
            MainProgram.UserEquip_OffhandNUM = "0"
        ElseIf InStr(LCase(MainProgram.UserEquip_Range), tmpa) Then
            MainProgram.AddItemHide = True
            MainProgram.User_additem(MainProgram.UserEquip_RangeNUM)
            MainProgram.SND("/gYou mainprogram.remove " + MainProgram.UserEquip_Range + "/g.")
            MainProgram.UserEquip_Range = "Empty"
            MainProgram.RemArmorClass(MainProgram.UserEquip_RangeNUM)
            MainProgram.UserEquip_RangeNUM = "0"
        Else
            MainProgram.SND("/rYou don't currently have " + tmpa + " equiped.")
        End If
    End Sub
    Private Sub CMD_wear(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmpb As String = "", tmpc As String
        Dim tmp0 As Integer
        For tmp0 = 0 To 39 Step 1
            If MainProgram.User_Inventory(tmp0) <> "" Or MainProgram.User_InventoryNUM(tmp0) <> "0" Then
                If InStr(LCase(LTrim(MainProgram.User_Inventory(tmp0))), tmpa) Then
                    LoadItem.LoadItem(MainProgram.User_InventoryNUM(tmp0))
                    If MainProgram.ItemData_SexRequirement = "None" Or MainProgram.ItemData_SexRequirement = MainProgram.User_Gender Then
                        If MainProgram.ItemData_ClassRequirement = "None" Then
                            If MainProgram.User_Level >= Val(MainProgram.ItemData_LevelRequirement) Then
                                If MainProgram.ItemData_BasicType = "Weapon" Then
                                    If MainProgram.ItemData_2Handed = "No" Then
                                        If MainProgram.UserEquip_Mainhand = "Empty" Then
                                            MainProgram.UserEquip_Mainhand = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_MainhandNUM = MainProgram.ItemData_VIRID
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                        Else
                                            tmpb = MainProgram.User_Inventory(tmp0)
                                            tmpc = MainProgram.User_InventoryNUM(tmp0)
                                            MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Mainhand
                                            MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_MainhandNUM
                                            MainProgram.UserEquip_Mainhand = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_MainhandNUM = tmpc
                                            MainProgram.RemArmorClass(tmp0)
                                        End If
                                        MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                        Exit For
                                    Else
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        'TWO HANDED WEAPONS FAIL, FIX
                                        If MainProgram.UserEquip_Mainhand = "Empty" And MainProgram.UserEquip_Offhand = "Empty" Then
                                            MainProgram.UserEquip_Mainhand = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_MainhandNUM = MainProgram.ItemData_VIRID
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                        Else
                                            If MainProgram.UserEquip_Mainhand = "Empty" And MainProgram.UserEquip_Offhand <> "Empty" Then
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Offhand
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_OffhandNUM
                                                MainProgram.UserEquip_Mainhand = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_MainhandNUM = tmpc
                                            ElseIf MainProgram.UserEquip_Mainhand <> "Empty" And MainProgram.UserEquip_Offhand = "Empty" Then
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Mainhand
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_MainhandNUM
                                                MainProgram.UserEquip_Mainhand = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_MainhandNUM = tmpc
                                            ElseIf MainProgram.UserEquip_Mainhand <> "Empty" And MainProgram.UserEquip_Offhand <> "Empty" Then
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Offhand
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_OffhandNUM
                                                MainProgram.UserEquip_Mainhand = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_MainhandNUM = tmpc
                                            End If
                                        End If
                                        MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                        Exit For
                                    End If
                                ElseIf MainProgram.ItemData_BasicType = "Armor" Then
                                    If MainProgram.ItemData_ITEMT = "Head" Then
                                        If MainProgram.UserEquip_Head = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Head = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_HeadNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Head
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_HeadNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Head = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_HeadNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Shoulders" Then
                                        If MainProgram.UserEquip_Shoulders = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Shoulders = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_ShouldersNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Shoulders
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_ShouldersNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Shoulders = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_ShouldersNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Arms" Then
                                        If MainProgram.UserEquip_Arms = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Arms = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_ArmsNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Arms
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_ArmsNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Arms = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_ArmsNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Wrists" Then
                                        If MainProgram.UserEquip_Wrists = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Wrists = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_WristsNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Wrists
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_WristsNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Wrists = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_WristsNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Hands" Then
                                        If MainProgram.UserEquip_Hands = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Hands = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_HandsNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Hands
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_HandsNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Hands = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_HandsNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Finger" Then    'checks to see if either finger is empty, if not, it replaces the left finger
                                        If MainProgram.UserEquip_LFinger = "Empty" Then
                                            MainProgram.UserEquip_LFinger = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_LFinger = MainProgram.User_InventoryNUM(tmp0)
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                        Else
                                            If MainProgram.UserEquip_RFinger = "Empty" Then
                                                MainProgram.UserEquip_RFinger = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_RFinger = MainProgram.User_InventoryNUM(tmp0)
                                                MainProgram.User_Inventory(tmp0) = ""
                                                MainProgram.User_InventoryNUM(tmp0) = ""
                                            Else
                                                MainProgram.RemArmorClass(tmp0)
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_LFinger
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_LFingerNUM
                                                MainProgram.UserEquip_LFinger = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_LFingerNUM = tmpc
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Neck" Then
                                        If MainProgram.UserEquip_Neck = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Neck = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_NeckNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Neck
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_NeckNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Neck = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_NeckNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Chest" Then
                                        If MainProgram.UserEquip_Chest = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Chest = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_ChestNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Chest
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_ChestNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Chest = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_ChestNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Waist" Then
                                        If MainProgram.UserEquip_Waist = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Waist = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_WaistNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Waist
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_WaistNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Waist = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_WaistNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Legs" Then
                                        If MainProgram.UserEquip_Legs = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Legs = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_LegsNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Legs
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_LegsNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Legs = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_LegsNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Feet" Then
                                        If MainProgram.UserEquip_Boots = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Boots = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_BootsNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Boots
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_BootsNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Boots = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_BootsNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Back" Then
                                        If MainProgram.UserEquip_Back = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Back = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_BackNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Back
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_BackNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Back = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_BackNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    ElseIf MainProgram.ItemData_ITEMT = "Shield" Then
                                        If MainProgram.UserEquip_Offhand = "Empty" Then
                                            'wear item, none currently equipped, set item and it's vnum
                                            MainProgram.UserEquip_Offhand = MainProgram.ItemData_ITEMN
                                            MainProgram.UserEquip_OffhandNUM = MainProgram.User_InventoryNUM(tmp0)
                                            'clear item from its previous inventory number
                                            MainProgram.User_Inventory(tmp0) = ""
                                            MainProgram.User_InventoryNUM(tmp0) = ""
                                            'show the item is equiped
                                            MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                            'add the armor class of the item
                                            MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                            MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                        Else
                                            If MainProgram.User_InventoryNUM(39) <> "0" Then
                                                MainProgram.SND("/gCan't equip " + MainProgram.ItemData_ITEMN + "/g, your inventory is full.")
                                            Else
                                                'save the item information to temporary variables as we mainprogram.remove the previous item
                                                tmpb = MainProgram.User_Inventory(tmp0)
                                                tmpc = MainProgram.User_InventoryNUM(tmp0)
                                                'add the previous item to the inventory
                                                MainProgram.User_Inventory(tmp0) = MainProgram.UserEquip_Offhand
                                                MainProgram.User_InventoryNUM(tmp0) = MainProgram.UserEquip_OffhandNUM
                                                'show the item being equiped and add it's armor class
                                                MainProgram.SND("/gYou equip " + MainProgram.ItemData_ITEMN + "/g.")
                                                MainProgram.AddArmorClass(MainProgram.ItemData_VIRID)
                                                'set the item as equiped using hte temporary variables it was saved to
                                                MainProgram.UserEquip_Offhand = MainProgram.ItemData_ITEMN
                                                MainProgram.UserEquip_OffhandNUM = tmpc
                                                'remove the previous armor class of the last item
                                                MainProgram.RemArmorClass(MainProgram.User_InventoryNUM(tmp0))
                                                MainProgram.CleanInventoryVariables() 'pushes all set variables to the front of the stack
                                            End If
                                        End If
                                    End If
                                Else
                                End If
                            Else
                                MainProgram.SND("/rYou are level " + LTrim(Str(MainProgram.User_Level)) + ", you need " + LTrim(Str(Val(MainProgram.ItemData_LevelRequirement) - MainProgram.User_Level)) + " more levels to use this.")
                            End If
                        Else
                            'DO YOU HAVE THE REQUIRED CLASS?
                        End If
                    Else
                        'DO YOU HAVE THE REQUIRED SEX?
                    End If
                End If
            End If
        Next
    End Sub
    Private Sub CMD_save(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        SavePlayer.saveplayer(1)
    End Sub
    Private Sub CMD_drop(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmp0 As Integer
        For tmp0 = 0 To 39 Step 1
            If MainProgram.User_Inventory(tmp0) <> "" Then
                If InStr(LCase(LTrim(MainProgram.User_Inventory(tmp0))), tmpa) Then
                    MainProgram.SND("/gYou drop " + MainProgram.User_Inventory(tmp0) + "/g.")
                    LoadItem.LoadItem(MainProgram.User_InventoryNUM(tmp0))
                    If MainProgram.MapData_DRTEM = "" Then
                        MainProgram.MapData_DRTEM = MainProgram.User_InventoryNUM(tmp0) + "|" + MainProgram.ItemData_LONGD
                    Else
                        MainProgram.MapData_DRTEM += "," + MainProgram.User_InventoryNUM(tmp0) + "|" + MainProgram.ItemData_LONGD
                    End If
                    MainProgram.User_Inventory(tmp0) = ""
                    MainProgram.User_InventoryNUM(tmp0) = ""
                    Exit For
                End If
            End If
        Next
        SaveTheSector()
    End Sub
    Private Sub CMD_pick(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmpb As String = LCase("," + MainProgram.MapData_DRTEM + ","), tmpc As String = ""
        Dim tmp0 As Integer, tmp1 As Integer, tmp2 As Integer, tmp3 As Integer
        If InStr(tmpb, tmpa) Then
            For tmp0 = InStr(tmpb, tmpa) To Len(tmpb) Step 1
                If Mid(tmpb, tmp0, 1) = "," Then
                    tmp1 = tmp0
                    Exit For
                End If
            Next
            For tmp0 = InStr(tmpb, tmpa) + 1 To 1 Step -1
                If Mid(tmpb, tmp0, 1) = "|" Then
                    tmp2 = tmp0
                    Exit For
                End If
            Next
            If tmp2 > 0 Then
                For tmp0 = tmp2 To 1 Step -1
                    If Mid(tmpb, tmp0, 1) = "," Then
                        tmp3 = tmp0
                        Exit For
                    End If
                Next
                tmpc = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3), "")
                If InStr(tmpc, "|") Then
                    MainProgram.MapData_DRTEM = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3), "")
                Else
                    MainProgram.MapData_DRTEM = ""
                End If
                LoadItem.LoadItem(Mid(tmpb, tmp3 + 1, tmp2 - 1 - tmp3))
                MainProgram.User_additem(Mid(tmpb, tmp3 + 1, tmp2 - 1 - tmp3))
                SaveTheSector()
            End If
        End If
    End Sub
    Private Sub CMD_bury(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmpb As String = LCase("," + MainProgram.MapData_DRTEM + ","), tmpc As String = ""
        Dim tmp0 As Integer, tmp1 As Integer, tmp2 As Integer, tmp3 As Integer
        If InStr(tmpb, tmpa) Then
            For tmp0 = InStr(tmpb, tmpa) To Len(tmpb) Step 1
                If Mid(tmpb, tmp0, 1) = "," Then
                    tmp1 = tmp0
                    Exit For
                End If
            Next
            For tmp0 = InStr(tmpb, tmpa) + 1 To 1 Step -1
                If Mid(tmpb, tmp0, 1) = "|" Then
                    tmp2 = tmp0
                    Exit For
                End If
            Next
            If tmp2 > 0 Then
                For tmp0 = tmp2 To 1 Step -1
                    If Mid(tmpb, tmp0, 1) = "," Then
                        tmp3 = tmp0
                        Exit For
                    End If
                Next
                tmpc = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3), "", 1, 1)
                If InStr(tmpc, "|") Then
                    MainProgram.MapData_DRTEM = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3) + ",", "")
                    If Mid(MainProgram.MapData_DRTEM, 1, 1) = "," Then
                        MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 2, Len(MainProgram.MapData_DRTEM))
                    End If
                    If Mid(MainProgram.MapData_DRTEM, Len(MainProgram.MapData_DRTEM), 1) = "," Then
                        MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 1, Len(MainProgram.MapData_DRTEM) - 1)
                    End If
                Else
                    MainProgram.MapData_DRTEM = ""
                End If
                LoadItem.LoadItem(Mid(tmpb, tmp3 + 1, tmp2 - 1 - tmp3))
                MainProgram.SND("/gYou dig a hole and bury " + MainProgram.ItemData_SHORT + ".")
                SaveTheSector()
            End If
        End If
    End Sub
    Private Sub CMD_sacrifice(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmpb As String = LCase("," + MainProgram.MapData_DRTEM + ","), tmpc As String = ""
        Dim tmp0 As Integer, tmp1 As Integer, tmp2 As Integer, tmp3 As Integer
        If InStr(tmpb, tmpa) Then
            For tmp0 = InStr(tmpb, tmpa) To Len(tmpb) Step 1
                If Mid(tmpb, tmp0, 1) = "," Then
                    tmp1 = tmp0
                    Exit For
                End If
            Next
            For tmp0 = InStr(tmpb, tmpa) + 1 To 1 Step -1
                If Mid(tmpb, tmp0, 1) = "|" Then
                    tmp2 = tmp0
                    Exit For
                End If
            Next
            If tmp2 > 0 Then
                For tmp0 = tmp2 To 1 Step -1
                    If Mid(tmpb, tmp0, 1) = "," Then
                        tmp3 = tmp0
                        Exit For
                    End If
                Next
                tmpc = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3), "", 1, 1)
                If InStr(tmpc, "|") Then
                    MainProgram.MapData_DRTEM = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3) + ",", "")
                    If Mid(MainProgram.MapData_DRTEM, 1, 1) = "," Then
                        MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 2, Len(MainProgram.MapData_DRTEM))
                    End If
                    If Mid(MainProgram.MapData_DRTEM, Len(MainProgram.MapData_DRTEM), 1) = "," Then
                        MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 1, Len(MainProgram.MapData_DRTEM) - 1)
                    End If
                Else
                    MainProgram.MapData_DRTEM = ""
                End If
                LoadItem.LoadItem(Mid(tmpb, tmp3 + 1, tmp2 - 1 - tmp3))
                MainProgram.SND("/gYou sacrifice " + MainProgram.ItemData_SHORT + ", destroying all evidence.")
                SaveTheSector()
            End If
        End If
    End Sub
    Private Sub CMD_take(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Dim tmpb As String = LCase("," + MainProgram.MapData_DRTEM + ","), tmpc As String = ""
        Dim tmp0 As Integer, tmp1 As Integer, tmp2 As Integer, tmp3 As Integer
        If InStr(tmpb, tmpa) Then
            For tmp0 = InStr(tmpb, tmpa) To Len(tmpb) Step 1
                If Mid(tmpb, tmp0, 1) = "," Then
                    tmp1 = tmp0
                    Exit For
                End If
            Next
            For tmp0 = InStr(tmpb, tmpa) + 1 To 1 Step -1
                If Mid(tmpb, tmp0, 1) = "|" Then
                    tmp2 = tmp0
                    Exit For
                End If
            Next
            If tmp2 > 0 Then
                For tmp0 = tmp2 To 1 Step -1
                    If Mid(tmpb, tmp0, 1) = "," Then
                        tmp3 = tmp0
                        Exit For
                    End If
                Next
                tmpc = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3), "", 1, 1)
                If InStr(tmpc, "|") Then
                    MainProgram.MapData_DRTEM = Replace(tmpb, Mid(tmpb, tmp3, tmp1 - tmp3) + ",", "")
                    If Mid(MainProgram.MapData_DRTEM, 1, 1) = "," Then
                        MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 2, Len(MainProgram.MapData_DRTEM))
                    End If
                    If Mid(MainProgram.MapData_DRTEM, Len(MainProgram.MapData_DRTEM), 1) = "," Then
                        MainProgram.MapData_DRTEM = Mid(MainProgram.MapData_DRTEM, 1, Len(MainProgram.MapData_DRTEM) - 1)
                    End If
                Else
                    MainProgram.MapData_DRTEM = ""
                End If
                LoadItem.LoadItem(Mid(tmpb, tmp3 + 1, tmp2 - 1 - tmp3))
                MainProgram.User_additem(Mid(tmpb, tmp3 + 1, tmp2 - 1 - tmp3))
                SaveTheSector()
            End If
        End If
    End Sub
    'unfinished
    Private Sub CMD_eat(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.SND("/RBROKEN FIX")
    End Sub
    'unfinished
    Private Sub CMD_drink(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.SND("/RBROKEN FIX")
    End Sub
    'unfinished
    Private Sub CMD_affects(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        MainProgram.SND("/gYou look within your bags...")
        MainProgram.SND("/W[IIIIIIIIIII)Affects(IIIIIIIIIII]")
        'For tmp0 = 0 To 39 Step 1
        'If MainProgram.User_Inventory(tmp0) <> "" Then
        'SND("/w " + MainProgram.User_Inventory(tmp0))
        'End If
        'Next
        MainProgram.SND("/W[IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII]")
    End Sub
    Private Sub CMD_calendar(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmp0 As Integer
        Dim line As String = "/c* "
        Dim linenum As Short = 1
        Dim catnum = 0
        Dim linedesc(6) As String
        Dim m1 As String = "/c1", m2 As String = "/c2", m3 As String = "/c3", m4 As String = "/c4"
        Dim m5 As String = "/c5", m6 As String = "/c6", m7 As String = "/c7", m8 As String = "/c8"
        Dim m9 As String = "/c9", m10 As String = "/c10", m11 As String = "/c11"
        If MainProgram.Serverdatemonth = "Turn of Ritkus" Then
            m1 = "/C1"
            linedesc(0) = "Ritkus was the oldest of"
            linedesc(1) = "the ancients Lythantos gave"
            linedesc(2) = "to Urd. The Turning of Ritkus"
            linedesc(3) = "is the allusion to his power"
            linedesc(4) = "of turning Urd into the Sun"
            linedesc(5) = "causing the return of a new"
            linedesc(6) = "season."
        ElseIf MainProgram.Serverdatemonth = "Lythantos' Breath" Then
            m2 = "/C2"
            linedesc(0) = "Lythantos' Breath is a windy"
            linedesc(1) = "season, that mostly affects"
            linedesc(2) = "the coastal regions like Crecia."
            linedesc(3) = "It is a cooler month, and"
            linedesc(4) = "precedes The Shaded Aveo."
            linedesc(5) = ""
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "The Shaded Aveo" Then
            m3 = "/C3"
            linedesc(0) = "The Shaded Aveo is the last"
            linedesc(1) = "cool month before Urd reaches"
            linedesc(2) = "its closest point to the Sun."
            linedesc(3) = "The Aveo is a shade tree, a"
            linedesc(4) = "coined Semordnilap for what"
            linedesc(5) = "they used to call the sun:"
            linedesc(6) = "Oeva."
        ElseIf MainProgram.Serverdatemonth = "The Burning Oeva" Then
            m4 = "/C4"
            linedesc(0) = "The Burning Oeva is the most"
            linedesc(1) = "uncomfortable time of year for"
            linedesc(2) = "many, as its the hottest time"
            linedesc(3) = "of the year. Oeva is an older"
            linedesc(4) = "word for what they now call"
            linedesc(5) = "sun."
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "The Dying Flower" Then
            m5 = "/C5"
            linedesc(0) = "The Dying Flower is a hot time"
            linedesc(1) = "of year where the seasons begin"
            linedesc(2) = "to change slightly, the plants"
            linedesc(3) = "begin to dry up and wood begins"
            linedesc(4) = "to be cut for the colder weather"
            linedesc(5) = "ahead."
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "Roahn's Becoming" Then
            m6 = "/C6"
            linedesc(0) = "Roahn's Becoming shows a change"
            linedesc(1) = "into cooler weather, the plants"
            linedesc(2) = "are still dying. Roahn was a"
            linedesc(3) = "cleric for Dekkashraen, who"
            linedesc(4) = "betrayed his lord for Lythantos"
            linedesc(5) = "people of the spire. It signifies"
            linedesc(6) = "The end of the War of Souls."
        ElseIf MainProgram.Serverdatemonth = "Falling Leaf" Then
            m7 = "/C7"
            linedesc(0) = "The falling leaf is a cooler"
            linedesc(1) = "time of the year, where fire"
            linedesc(2) = "wood is collected and people"
            linedesc(3) = "prepare for the colder weather"
            linedesc(4) = "ahead."
            linedesc(5) = ""
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "Winterblight" Then
            m8 = "/C8"
            linedesc(0) = "Winterblight is a sudden"
            linedesc(1) = "change, and is the coldest"
            linedesc(2) = "point of the year. Trade is"
            linedesc(3) = "at its lowest at this point"
            linedesc(4) = "of the year."
            linedesc(5) = ""
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "Changing Tide" Then
            m9 = "/C9"
            linedesc(0) = "The Changing Tide is where"
            linedesc(1) = "most of the snow melts in the"
            linedesc(2) = "mid-regions of Sedia. It"
            linedesc(3) = "Represents the idealistic"
            linedesc(4) = "return of the Lady Ettphemone."
            linedesc(5) = ""
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "Mahro's Blessing" Then
            m10 = "/C10"
            linedesc(0) = "Mahro was the only child that"
            linedesc(1) = "Lady Ettphemone and Lythantos"
            linedesc(2) = "ever made, only seen once by"
            linedesc(3) = "The people of Tharsis, her"
            linedesc(4) = "presence caused laments of"
            linedesc(5) = "praise, and peace for many years."
            linedesc(6) = ""
        ElseIf MainProgram.Serverdatemonth = "Ettphemones Return" Then
            m11 = "/C11"
            linedesc(0) = "Ettphemone's Return is where"
            linedesc(1) = "life begins to spurt again"
            linedesc(2) = "about the continent, animals"
            linedesc(3) = "leave hibernation and trade"
            linedesc(4) = "begins to flourish."
            linedesc(5) = ""
            linedesc(6) = ""
        End If
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /C" + MainProgram.Serverdatemonth + ", " + LTrim(Str(MainProgram.Serverdateyear)) + " " + MainProgram.Serverdateera)
        MainProgram.SND("/c* " + m1 + " " + m2 + " " + m3 + " " + m4 + " " + m5 + " " + m6 + " " + m7 + " " + m8 + " " + m9 + " " + m10 + " " + m11)
        MainProgram.SND("/c*/C**********************************************")
        For tmp0 = 1 To 30 Step 1
            If MainProgram.Serverdateday = tmp0 Then
                If tmp0 < 10 Then line += " "
                line = line + "/C" + LTrim(Str(MainProgram.Serverdateday))
                If linenum = 6 Then
                    linenum = 1
                    MainProgram.SND(line + " /z" + linedesc(catnum))
                    line = "/c* "
                    catnum += 1
                Else
                    linenum += 1
                    line = line + " "
                End If
            Else
                If tmp0 < 10 Then line += " "
                line = line + "/c" + LTrim(Str(tmp0))
                If linenum = 6 Then
                    linenum = 1
                    MainProgram.SND(line + " /z" + linedesc(catnum))
                    line = "/c* "
                    catnum += 1
                Else
                    linenum += 1
                    line = line + " "
                End If
            End If
        Next
        If linedesc(5) <> "" Then MainProgram.SND("                    /z" + linedesc(5))
        If linedesc(6) <> "" Then MainProgram.SND("                    /z" + linedesc(6))
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_time(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim minstr = LTrim(Str(MainProgram.servertimeminute))
        Dim houstr = LTrim(Str(MainProgram.servertimehour))
        If Len(minstr) < 2 Then minstr = "0" + minstr
        If Len(houstr) < 2 Then houstr = "0" + houstr
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /CYour time                   Game Time")
        MainProgram.SND("/c***********************************************")
        MainProgram.SND("/c* " + TimeString + "                    " + houstr + ":" + minstr + ":00")
        MainProgram.SND("/c*/C**********************************************")
        'snd("servertimehour
    End Sub
    Private Sub CMD_quests(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmp0 As Integer
        MainProgram.SND("/gYou stop to mainprogram.remember your quests.")
        MainProgram.SND("/W[IIIIIII)CURRENT QUESTS(IIIIIIII]")
        For tmp0 = 0 To 9 Step 1
            If MainProgram.User_quest(tmp0) <> "" Then
                LoadMob(MainProgram.User_questtarget(LTrim(Str(tmp0))))
                If MainProgram.User_questcomplete(tmp0) = True Then
                    MainProgram.SND("/w " + LTrim(Str(tmp0 + 1)) + ". /Y(COMPLETE) /wKill " + MainProgram.MobData_SHORT + "/w.")
                Else
                    MainProgram.SND("/w " + LTrim(Str(tmp0 + 1)) + ". Kill " + MainProgram.MobData_SHORT + "/w.")
                End If
            End If
        Next
        MainProgram.SND("/W[IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII]")
    End Sub
    Private Sub CMD_pdesc(ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, nputlen + 1, Len(txt))))
        MainProgram.User_Description = tmpa
        MainProgram.SND("/YYour personal description has been set!")
    End Sub
#End Region
#Region "Admin Edit Server Commands"
    Private Sub CMD_editserver_minutes(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        Dim oldminutes As String
        If Val(tmpa) > 0 And Val(tmpa) < 60 Then
            oldminutes = LTrim(Str(MainProgram.servertimeminute))
            MainProgram.servertimeminute = Val(tmpa)
            MainProgram.SND("/YServer minutes '" + oldminutes + "' changed to /z-> '/g" + LTrim(Str(MainProgram.servertimeminute)) + "/z'")
        Else
            MainProgram.SND("/RInvalid minute, there are 60 minutes in an hour.")
        End If
    End Sub
    Private Sub CMD_editserver_hours(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        Dim oldhours As String
        If Val(tmpa) > 0 And Val(tmpa) < 60 Then
            oldhours = LTrim(Str(MainProgram.servertimehour))
            MainProgram.servertimehour = Val(tmpa)
            MainProgram.SND("/YServer hours '" + oldhours + "' changed to /z-> '/g" + LTrim(Str(MainProgram.servertimehour)) + "/z'")
        Else
            MainProgram.SND("/RInvalid hour, there are 24 hours in a day.")
        End If
    End Sub
    Private Sub CMD_editserver_days(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        Dim oldday As String
        If Val(tmpa) > 0 And Val(tmpa) < 31 Then
            oldday = LTrim(Str(MainProgram.Serverdateday))
            MainProgram.Serverdateday = Val(tmpa)
            MainProgram.SND("/YServer day '" + oldday + "' changed to /z-> '/g" + LTrim(Str(MainProgram.Serverdateday)) + "/z'")
        Else
            MainProgram.SND("/RInvalid day, there are 30 days in a month.")
        End If
    End Sub
    Private Sub CMD_editserver_months(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        Dim oldmonth As String
        If Val(tmpa) > 0 And Val(tmpa) < 12 Then
            oldmonth = MainProgram.Serverdatemonth
            MainProgram.Serverdatemonth = MainProgram.Monthtostring(Val(tmpa))
            MainProgram.SND("/YServer month '" + oldmonth + "' changed to /z-> '/g" + MainProgram.Serverdatemonth + "/z'")
        Else
            MainProgram.SND("/RInvalid month, there are 11 months.")
        End If
    End Sub
    Private Sub CMD_editserver_years(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        Dim oldyear As String
        If Val(tmpa) > 0 And Val(tmpa) < 1000 Then
            oldyear = LTrim(Str(MainProgram.Serverdateyear))
            MainProgram.Serverdateyear = Val(tmpa)
            MainProgram.SND("/YServer year '" + oldyear + "' changed to /z-> '/g" + LTrim(Str(MainProgram.Serverdateyear)) + "/z'")
        Else
            MainProgram.SND("/RInvalid year, must be less than 1000 and greater than 0.")
        End If
    End Sub
    Private Sub CMD_editserver_eras(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        Dim oldera As String
        oldera = MainProgram.Serverdateera
        MainProgram.Serverdateera = tmpa
        MainProgram.SND("/YServer era '" + oldera + "' changed to /z-> '/g" + MainProgram.Serverdateera + "/z'")
    End Sub
#End Region
#Region "Builder Edit Commands"
    Private Sub CMD_editcur_northexit(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.UserLocation_NorthCNCT = Val(tmpa)
        SaveTheSector()
    End Sub
    Private Sub CMD_editcur_southexit(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.UserLocation_SouthCNCT = Val(tmpa)
        SaveTheSector()
    End Sub
    Private Sub CMD_editcur_eastexit(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.UserLocation_EastCNCT = Val(tmpa)
        SaveTheSector()
    End Sub
    Private Sub CMD_editcur_westexit(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.UserLocation_WestCNCT = Val(tmpa)
        SaveTheSector()
    End Sub
    Private Sub CMD_editcur_upexit(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.UserLocation_UpCNCT = Val(tmpa)
        SaveTheSector()
    End Sub
    Private Sub CMD_editcur_downexit(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.UserLocation_DownCNCT = Val(tmpa)
        SaveTheSector()
    End Sub
    Private Sub CMD_editcur_description(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.MapData_SECTD = tmpa
        SaveTheSector()
        MainProgram.SND("/YSector Description Changed /z-> /g" + LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive)))))
    End Sub
    Private Sub CMD_editcur_characters(ByVal casesensitive As String, ByVal txt As String, ByVal cmdlen As Short, ByVal nputlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive))))
        MainProgram.MapData_CCHAR = tmpa
        SaveTheSector()
        MainProgram.SND("/YSector Characters Changed /z-> /g" + LTrim(RTrim(Mid(casesensitive, cmdlen + 1, Len(casesensitive)))))
    End Sub
#End Region
#Region "Preview Admin Commands"
    Private Sub CMD_prev_dumpmaps()
        DebugWindow.ClearSND(MainProgram.MapData)
    End Sub
    Private Sub CMD_prev_dumpemotes()
        DebugWindow.ClearSND(MainProgram.EmoteData)
    End Sub
    Private Sub CMD_prev_dumpmobiles()
        DebugWindow.ClearSND(MainProgram.MobData)
    End Sub
    Private Sub CMD_prev_dumpplayers()
        DebugWindow.ClearSND(MainProgram.User_Data)
    End Sub
    Private Sub CMD_prev_dumpscripts()
        DebugWindow.ClearSND(MainProgram.ScriptData)
    End Sub
    Private Sub CMD_prev_dumpitems()
        MainProgram.ItemData = MainProgram.GetFileContents(MainProgram.DirItems, MainProgram.sErr)
        DebugWindow.ClearSND(MainProgram.ItemData)
    End Sub
    Private Sub CMD_prev_dumpcustomitems()
        MainProgram.ItemData = MainProgram.CustomItemData
        DebugWindow.ClearSND(MainProgram.CustomItemData)
    End Sub
    Private Sub CMD_prev_quest_information()
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /CQuest Slot Information")
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* # Status Giver Target Description")
        MainProgram.SND("/c*/c----------------------------------------------")
        Dim qtmp As Short = 0
        For qtmp = 0 To 9 Step 1
            MainProgram.SND("/c* " + LTrim(Str(qtmp)) + " " + Str(MainProgram.User_questcomplete(qtmp)) + "  " + MainProgram.User_questgiver(qtmp) + "     " + MainProgram.User_questtarget(qtmp) + "     " + MainProgram.User_quest(qtmp))
        Next
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_prev_equip_information()
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /CEquipment Items")
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c*           ID Item")
        MainProgram.SND("/c*/c----------------------------------------------")
        MainProgram.SND("/c Head     /Z:/z " + MainProgram.UserEquip_HeadNUM + " " + MainProgram.UserEquip_Head)
        MainProgram.SND("/c Neck     /Z:/z " + MainProgram.UserEquip_NeckNUM + " " + MainProgram.UserEquip_Neck)
        MainProgram.SND("/c Shoulders/Z:/z " + MainProgram.UserEquip_ShouldersNUM + " " + MainProgram.UserEquip_Shoulders)
        MainProgram.SND("/c Arms     /Z:/z " + MainProgram.UserEquip_ArmsNUM + " " + MainProgram.UserEquip_Arms)
        MainProgram.SND("/c Wrists   /Z:/z " + MainProgram.UserEquip_WristsNUM + " " + MainProgram.UserEquip_Wrists)
        MainProgram.SND("/c Hands    /Z:/z " + MainProgram.UserEquip_HandsNUM + " " + MainProgram.UserEquip_Hands)
        MainProgram.SND("/c LFinger  /Z:/z " + MainProgram.UserEquip_LFingerNUM + " " + MainProgram.UserEquip_LFinger)
        MainProgram.SND("/c RFinger  /Z:/z " + MainProgram.UserEquip_RFingerNUM + " " + MainProgram.UserEquip_RFinger)
        MainProgram.SND("/c Chest    /Z:/z " + MainProgram.UserEquip_ChestNUM + " " + MainProgram.UserEquip_Chest)
        MainProgram.SND("/c Belt     /Z:/z " + MainProgram.UserEquip_WaistNUM + " " + MainProgram.UserEquip_Waist)
        MainProgram.SND("/c Legs     /Z:/z " + MainProgram.UserEquip_LegsNUM + " " + MainProgram.UserEquip_Legs)
        MainProgram.SND("/c Boots    /Z:/z " + MainProgram.UserEquip_BootsNUM + " " + MainProgram.UserEquip_Boots)
        MainProgram.SND("/c Mainhand /Z:/z " + MainProgram.UserEquip_MainhandNUM + " " + MainProgram.UserEquip_Mainhand)
        MainProgram.SND("/c Offhand  /Z:/z " + MainProgram.UserEquip_OffhandNUM + " " + MainProgram.UserEquip_Offhand)
        MainProgram.SND("/c Range    /Z:/z " + MainProgram.UserEquip_RangeNUM + " " + MainProgram.UserEquip_Range)
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_prev_inv_information()
        Dim tmpb As Short = 0
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /CInventory Items")
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /c#  ID Item")
        MainProgram.SND("/c*/c----------------------------------------------")
        For tmpb = 1 To 39 Step 1
            If MainProgram.User_Inventory(tmpb) <> "" Then
                MainProgram.SND("/c* " + LTrim(Str(tmpb)) + ":/z " + MainProgram.User_InventoryNUM(tmpb) + "  " + MainProgram.User_Inventory(tmpb))
            End If
        Next
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_prev_cursector(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmp0 As Integer, tmp1 As Integer = Val(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))), tmpA As String = ""
        For tmp0 = InStr(MainProgram.MapData, "TOTAL#") To Len(MainProgram.MapData) Step 1
            If Mid(MainProgram.MapData, tmp0, 1) = "(" Then
                tmpA = Mid(MainProgram.MapData, InStr(MainProgram.MapData, "TOTAL#") + 6, tmp0 - 6 - InStr(MainProgram.MapData, "TOTAL#"))
                Exit For
            End If
        Next
        LoadSector.LoadSector(MainProgram.UserLocation_Sector, False)
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* /CSector Number: /c" + LTrim(Str(MainProgram.UserLocation_Sector)) + "/" + tmpA)
        MainProgram.SND("/c*/C**********************************************")
        MainProgram.SND("/c* World      :/z " + MainProgram.UserLocation_WorldString)
        MainProgram.SND("/c* Continent  :/z " + MainProgram.UserLocation_ContinentString)
        MainProgram.SND("/c* Province   :/z " + MainProgram.UserLocation_ProvinceString)
        MainProgram.SND("/c* Area       :/z " + MainProgram.UserLocation_AreaString)
        MainProgram.SND("/c* Map        :/z " + MainProgram.UserLocation_MapString)
        MainProgram.SND("/c* Sector     :/z " + MainProgram.UserLocation_SectorString)
        MainProgram.SND("/c* Environment:/z " + MainProgram.MapData_EnvironString)
        MainProgram.SND("/c* Weather    :/z " + MainProgram.MapData_EnvironWeather)
        MainProgram.SND("/c* Temperature:/z " + LTrim(Str(MainProgram.MapData_EnvironTemp)))
        MainProgram.SND("/c* Magic Mod  :/z " + MainProgram.MapData_EnvironMagic)
        MainProgram.SND("/c* Environ Des:/z " + MainProgram.MapData_EnvironDesc)
        MainProgram.SND("/c* Accessible :/z " + Str(MainProgram.UserLocation_Accessible))
        MainProgram.SND("/c***********************************************")
        If MainProgram.MapData_SECTD <> "" Then MainProgram.SND("/c* Description:/z " + MainProgram.MapData_SECTD) Else MainProgram.SND("/c* Description: /zNone")
        If MainProgram.MapData_CCHAR <> "" Then MainProgram.SND("/c* Current Characters:/z " + MainProgram.MapData_CCHAR) Else MainProgram.SND("/c* Current Characters: /zNone")
        Dim CFlags As String = LCase(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.MapData_CurrentMobs, "]A ", "]"), "]An ", "]"), " ", ","), "[]", ","), "]The ", "]"), " A ", ""), " An ", ""), " The ", ""))
        If MainProgram.MapData_CurrentMobs <> "" Then MainProgram.SND("/c* Current Character Flags:/z " + Mid(CFlags, 1, Len(CFlags) - 1)) Else MainProgram.SND("/c* Current Characters Loaded: /zNone")
        If MainProgram.MapData_STATC <> "" Then MainProgram.SND("/c* Current Props:/z " + MainProgram.MapData_STATC) Else MainProgram.SND("/c* Current Props: /zNone")
        CFlags = LCase(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.MapData_CurrentProps, "]A ", "]"), "]An ", "]"), " ", ","), "[]", ","), "]The ", "]"), " A ", ""), " An ", ""), " The ", ""), "[", ""), "]", ","), "1", ""), "2", ""), "3", ""), "4", ""), "5", ""), "6", ""), "7", ""), "8", ""), "9", ""), "0", ""), ".", ""))
        If MainProgram.MapData_CurrentProps <> "" Then MainProgram.SND("/c* Current Prop Flags:/z " + Mid(CFlags, 1, Len(CFlags) - 1)) Else MainProgram.SND("/c* Current Props Loaded: /zNone")
        If MainProgram.MapData_DRTEM <> "" Then MainProgram.SND("/c* Dropped Items:/z " + MainProgram.MapData_DRTEM) Else MainProgram.SND("/c* Dropped Items: /zNone")
        MainProgram.SND("/c***********************************************")
        If MainProgram.UserLocation_WestCNCT > 0 Then
            MainProgram.SND("/c* West Connection: /zOpen - " + Str(MainProgram.UserLocation_WestCNCT))
        Else
            MainProgram.SND("/c* West Connection: /zNone")
        End If
        If MainProgram.UserLocation_EastCNCT > 0 Then
            MainProgram.SND("/c* East Connection: /zOpen - " + Str(MainProgram.UserLocation_EastCNCT))
        Else
            MainProgram.SND("/c* East Connection: /zNone")
        End If
        If MainProgram.UserLocation_NorthCNCT > 0 Then
            MainProgram.SND("/c* North Connection: /zOpen - " + Str(MainProgram.UserLocation_NorthCNCT))
        Else
            MainProgram.SND("/c* North Connection: /zNone")
        End If
        If MainProgram.UserLocation_SouthCNCT > 0 Then
            MainProgram.SND("/c* South Connection: /zOpen - " + Str(MainProgram.UserLocation_SouthCNCT))
        Else
            MainProgram.SND("/c* South Connection: /zNone")
        End If
        If MainProgram.UserLocation_UpCNCT > 0 Then
            MainProgram.SND("/c* Up Connection: /zOpen - " + Str(MainProgram.UserLocation_UpCNCT))
        Else
            MainProgram.SND("/c* Up Connection: /zNone")
        End If
        If MainProgram.UserLocation_DownCNCT > 0 Then
            MainProgram.SND("/c* Down Connection: /zOpen - " + Str(MainProgram.UserLocation_DownCNCT))
        Else
            MainProgram.SND("/c* Down Connection : /zNone")
        End If
        MainProgram.SND("/c*/C**********************************************")
    End Sub
    Private Sub CMD_prev_loadmob(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        MainProgram.MobData = MainProgram.GetFileContents(MainProgram.DirMobs, MainProgram.sErr)
        Dim tmp0 As Integer, tmp1 As Integer = Val(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))), tmpA As String = ""
        For tmp0 = InStr(MainProgram.MobData, "TOTAL#") To Len(MainProgram.MobData) Step 1
            If Mid(MainProgram.MobData, tmp0, 1) = "(" Then
                tmpA = Mid(MainProgram.MobData, InStr(MainProgram.MobData, "TOTAL#") + 6, tmp0 - 6 - InStr(MainProgram.MobData, "TOTAL#"))
                Exit For
            End If
        Next
        Dim trunvar As Short = 0
        Dim linsw As Boolean = False
        If tmp1 <= Val(tmpA) Then
            LoadMobile.LoadMob(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            'MobData_DROP_dynamic1              addl8r
            'MobData_DROP_static1               addl8r
            MainProgram.SND("/c*/C**********************************************")
            MainProgram.SND("/c* /CMobile Number: /c" + LTrim(Str(tmp1)) + "/" + tmpA)
            MainProgram.SND("/c*/C**********************************************")
            MainProgram.SND("/c* /cMobile Name:/z " + MainProgram.MobData_MNAME)
            MainProgram.SND("/c* /cShort:/z " + MainProgram.MobData_SHORT)
            MainProgram.SND("/c* /cLong:/z " + MainProgram.MobData_LDESC)
            If MainProgram.MobData_LEVEL <> "" Then
                MainProgram.SND("/c* /cLevel:/z " + MainProgram.MobData_LEVEL)
            End If
            If MainProgram.MobData_HITPO <> "" Then
                MainProgram.SND("/c* /cHP:/z " + MainProgram.MobData_HITPO)
                MainProgram.SND("/c* /cWP:/z " + MainProgram.MobData_WILLP)
                MainProgram.SND("/c* /cSP:/z " + MainProgram.MobData_STAMP)
            End If
            'SND("/c* /cClass: " + mainprogram.mobData_CLASS)  'for some reason there is a duplicate _mobclass, commented until relevancy of variable
            MainProgram.SND("/c* /cMClass:/z " + MainProgram.MobData_MobClass)
            MainProgram.SND("/c* /cCombatP:/z " + MainProgram.MobData_MobClassCombatPreset)
            MainProgram.SND("/c* /cRace:/z " + MainProgram.MobData_RACET)
            MainProgram.SND("/c* /cType:/z " + MainProgram.MobData_MobType)
            MainProgram.SND("/c* /cSentient:/z " + MainProgram.MobData_Sentient)
            MainProgram.SND("/c* /cArchetype:/z " + MainProgram.MobData_ARCHE)
            If MainProgram.MobData_TEMPE <> "" Then
                MainProgram.SND("/c* /cTemperment:/z " + MainProgram.MobData_TEMPE)
            End If
            MainProgram.SND("/c***********************************************")
            linsw = True
            If MainProgram.MobData_AC_bash <> "0" Then trunvar += 1
            If MainProgram.MobData_AC_slash <> "0" Then trunvar += 1
            If MainProgram.MobData_AC_pierce <> "0" Then trunvar += 1
            If MainProgram.MobData_AC_fist <> "0" Then trunvar += 1
            If MainProgram.MobData_AC_exotic <> "0" Then trunvar += 1
            If MainProgram.MobData_STR_bash <> "0" Then trunvar += 1
            If MainProgram.MobData_STR_slash <> "0" Then trunvar += 1
            If MainProgram.MobData_STR_pierce <> "0" Then trunvar += 1
            If MainProgram.MobData_STR_fist <> "0" Then trunvar += 1
            If MainProgram.MobData_STR_exotic <> "0" Then trunvar += 1
            If trunvar > 0 Then
                MainProgram.SND("/c* /cBAC:/z " + MainProgram.MobData_AC_bash + "/c BST:/z " + MainProgram.MobData_STR_bash)
                MainProgram.SND("/c* /cSAC:/z " + MainProgram.MobData_AC_slash + "/c SST:/z " + MainProgram.MobData_STR_slash)
                MainProgram.SND("/c* /cPAC:/z " + MainProgram.MobData_AC_pierce + "/c PST:/z " + MainProgram.MobData_STR_pierce)
                MainProgram.SND("/c* /cFAC:/z " + MainProgram.MobData_AC_fist + "/c FST:/z " + MainProgram.MobData_STR_fist)
                MainProgram.SND("/c* /cEAC:/z " + MainProgram.MobData_AC_exotic + "/c EST:/z " + MainProgram.MobData_STR_exotic)
                linsw = False
            Else
                MainProgram.SND("/c* /zMobile has no Armor Class or Piercing Strength")
            End If
            trunvar = 0
            If MainProgram.MobData_RES_fire <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_water <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_air <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_earth <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_spirit <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_fire <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_water <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_air <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_earth <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_spirit <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_subfire <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_subwater <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_subair <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_subearth <> "0" Then trunvar += 1
            If MainProgram.MobData_RES_subspirit <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_subfire <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_subwater <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_subair <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_subearth <> "0" Then trunvar += 1
            If MainProgram.MobData_AMP_subspirit <> "0" Then trunvar += 1
            If trunvar > 0 Then
                MainProgram.SND("/c* /cFire RES:/z " + MainProgram.MobData_RES_fire + "/c Fire AMP:/z " + MainProgram.MobData_AMP_fire + "/c SubFire RES:/z " + MainProgram.MobData_RES_subfire + "/c SubFire AMP:/z " + MainProgram.MobData_AMP_fire)
                MainProgram.SND("/c* /cWaterRES:/z " + MainProgram.MobData_RES_water + "/c WaterAMP:/z " + MainProgram.MobData_AMP_water + "/c SubWaterRES:/z " + MainProgram.MobData_RES_subwater + "/c SubWaterAMP:/z " + MainProgram.MobData_AMP_subwater)
                MainProgram.SND("/c* /cAir  RES:/z " + MainProgram.MobData_RES_air + "/c Air  AMP:/z " + MainProgram.MobData_AMP_air + "/c SubAir  RES:/z " + MainProgram.MobData_RES_subair + "/c SubAir  AMP:/z " + MainProgram.MobData_AMP_subair)
                MainProgram.SND("/c* /cEarthRES:/z " + MainProgram.MobData_RES_earth + "/c EarthAMP:/z " + MainProgram.MobData_AMP_earth + "/c SubEarthRES:/z " + MainProgram.MobData_RES_subearth + "/c SubEarthAMP:/z " + MainProgram.MobData_AMP_subearth)
                MainProgram.SND("/c* /cSpiriRES:/z " + MainProgram.MobData_RES_spirit + "/c SpiriAMP:/z " + MainProgram.MobData_AMP_spirit + "/c SubSpiriRES:/z " + MainProgram.MobData_RES_subearth + "/c SubSpiriAMP:/z " + MainProgram.MobData_AMP_subspirit)
            Else
                If linsw = False Then
                    MainProgram.SND("/c***********************************************")
                    linsw = True
                End If
                MainProgram.SND("/c* /zMobile has no Magical Amplifications or Resistances")
            End If
            If MainProgram.MobData_ARCHE = "Normal" Then

            End If
            If MainProgram.MobData_MOUNT_bag <> "" Then
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* /cMOUNT Bag:/z " + MainProgram.MobData_MOUNT_bag)
                MainProgram.SND("/c* /cMOUNT LVLReq:/z " + MainProgram.MobData_MOUNT_lvlreq)
                MainProgram.SND("/c* /cMOUNT Speed:/z " + MainProgram.MobData_MOUNT_speed)
                MainProgram.SND("/c* /cMOUNT COST Vern:/z " + MainProgram.MobData_MOUNT_verncost)
                MainProgram.SND("/c* /cMOUNT COST Dover:/z " + MainProgram.MobData_MOUNT_dovercost)
                MainProgram.SND("/c* /cMOUNT COST Sovern:/z " + MainProgram.MobData_MOUNT_soverncost)
            End If
            Dim PathingString As String = ""
            If MainProgram.MobData_PATHTYPE = 0 Then
                PathingString = "Doesn't Move"
            ElseIf MainProgram.MobData_PATHTYPE = 1 Then
                PathingString = "Strict Pathing"
            ElseIf MainProgram.MobData_PATHTYPE = 2 Then
                PathingString = "Loose Pathing"
            ElseIf MainProgram.MobData_PATHTYPE = 3 Then
                PathingString = "Very Loose Pathing"
            End If
            MainProgram.SND("/c***********************************************")
            MainProgram.SND("/c* /cPathing Type :/z " + PathingString)
            If MainProgram.MobData_PATHTYPE <> 0 Then
                MainProgram.SND("/c* /cPathing Route:/z " + MainProgram.MobData_PATH)
            End If
            trunvar = 0
            If MainProgram.MobData_HATE_class <> "None" Then trunvar += 1
            If MainProgram.MobData_LOVE_class <> "None" Then trunvar += 1
            If MainProgram.MobData_HATE_sex <> "None" Then trunvar += 1
            If MainProgram.MobData_LOVE_sex <> "None" Then trunvar += 1
            If MainProgram.MobData_HATE_race <> "None" Then trunvar += 1
            If MainProgram.MobData_LOVE_race <> "None" Then trunvar += 1
            If trunvar > 0 Then
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* /cHated Class(s):/z " + MainProgram.MobData_HATE_class)
                MainProgram.SND("/c* /cLoved Class(s):/z " + MainProgram.MobData_LOVE_class)
                MainProgram.SND("/c* /cHated Sex(es) :/z " + MainProgram.MobData_HATE_sex)
                MainProgram.SND("/c* /cLoved Sex(es) :/z " + MainProgram.MobData_LOVE_sex)
                MainProgram.SND("/c* /cHated Race(s) :/z " + MainProgram.MobData_HATE_race)
                MainProgram.SND("/c* /cloved race(s) :/z " + MainProgram.MobData_LOVE_race)
            Else
                MainProgram.SND("/c* /zMobile has no predjudices")
            End If
            trunvar = 0
            If Len(MainProgram.MobData_DamageCrit(0)) > 1 Then trunvar += 1
            If Len(MainProgram.MobData_DamageCrit(1)) > 1 Then trunvar += 1
            If Len(MainProgram.MobData_DamageCrit(2)) > 1 Then trunvar += 1
            If Len(MainProgram.MobData_DamageCrit(3)) > 1 Then trunvar += 1
            If Len(MainProgram.MobData_DamageCrit(4)) > 1 Then trunvar += 1
            Dim trunspeed As String
            If trunvar = 1 Then
                If Len(MainProgram.MobData_DamageSpeed(0)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(0), 1, Len(MainProgram.MobData_DamageSpeed(0)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(0), Len(MainProgram.MobData_DamageSpeed(0)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(0) + " Tenths of a Second"
                End If
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* mainprogram.Damage Type One:/z " + MainProgram.MobData_DamageName(0))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(0) + "d" + MainProgram.MobData_DamageDieType(0))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(0))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(0))
            ElseIf trunvar = 2 Then
                If Len(MainProgram.MobData_DamageSpeed(0)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(0), 1, Len(MainProgram.MobData_DamageSpeed(0)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(0), Len(MainProgram.MobData_DamageSpeed(0)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(0) + " Tenths of a Second"
                End If
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* mainprogram.Damage Type One:/z " + MainProgram.MobData_DamageName(0))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(0) + "d" + MainProgram.MobData_DamageDieType(0))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(0))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(0))
                If Len(MainProgram.MobData_DamageSpeed(1)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(1), 1, Len(MainProgram.MobData_DamageSpeed(1)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(1), Len(MainProgram.MobData_DamageSpeed(1)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(1) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Two:/z " + MainProgram.MobData_DamageName(1))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(1) + "d" + MainProgram.MobData_DamageDieType(1))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(1))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(1))
            ElseIf trunvar = 3 Then
                If Len(MainProgram.MobData_DamageSpeed(0)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(0), 1, Len(MainProgram.MobData_DamageSpeed(0)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(0), Len(MainProgram.MobData_DamageSpeed(0)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(0) + " Tenths of a Second"
                End If
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* mainprogram.Damage Type One:/z " + MainProgram.MobData_DamageName(0))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(0) + "d" + MainProgram.MobData_DamageDieType(0))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(0))
                MainProgram.SND("/c*    Critical Hit/z " + MainProgram.MobData_DamageCrit(0))
                If Len(MainProgram.MobData_DamageSpeed(1)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(1), 1, Len(MainProgram.MobData_DamageSpeed(1)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(1), Len(MainProgram.MobData_DamageSpeed(1)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(1) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Two:/z " + MainProgram.MobData_DamageName(1))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(1) + "d" + MainProgram.MobData_DamageDieType(1))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(1))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(1))
                If Len(MainProgram.MobData_DamageSpeed(2)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(2), 1, Len(MainProgram.MobData_DamageSpeed(2)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(2), Len(MainProgram.MobData_DamageSpeed(2)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(2) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Three:/z " + MainProgram.MobData_DamageName(2))
                MainProgram.SND("/c*               Die:/z " + MainProgram.MobData_DamageDieNum(2) + "d" + MainProgram.MobData_DamageDieType(2))
                MainProgram.SND("/c*             Speed:/z " + trunspeed)
                MainProgram.SND("/c*              Type:/z " + MainProgram.MobData_DamageType(2))
                MainProgram.SND("/c*      Critical Hit:/z " + MainProgram.MobData_DamageCrit(2))
            ElseIf trunvar = 4 Then
                If Len(MainProgram.MobData_DamageSpeed(0)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(0), 1, Len(MainProgram.MobData_DamageSpeed(0)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(0), Len(MainProgram.MobData_DamageSpeed(0)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(0) + " Tenths of a Second"
                End If
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* mainprogram.Damage Type One:/z " + MainProgram.MobData_DamageName(0))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(0) + "d" + MainProgram.MobData_DamageDieType(0))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(0))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(0))
                If Len(MainProgram.MobData_DamageSpeed(1)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(1), 1, Len(MainProgram.MobData_DamageSpeed(1)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(1), Len(MainProgram.MobData_DamageSpeed(1)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(1) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Two:/z " + MainProgram.MobData_DamageName(1))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(1) + "d" + MainProgram.MobData_DamageDieType(1))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(1))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(1))
                If Len(MainProgram.MobData_DamageSpeed(2)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(2), 1, Len(MainProgram.MobData_DamageSpeed(2)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(2), Len(MainProgram.MobData_DamageSpeed(2)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(2) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Three:/z " + MainProgram.MobData_DamageName(2))
                MainProgram.SND("/c*               Die:/z " + MainProgram.MobData_DamageDieNum(2) + "d" + MainProgram.MobData_DamageDieType(2))
                MainProgram.SND("/c*             Speed:/z " + trunspeed)
                MainProgram.SND("/c*              Type:/z " + MainProgram.MobData_DamageType(2))
                MainProgram.SND("/c*      Critical Hit:/z " + MainProgram.MobData_DamageCrit(2))
                If Len(MainProgram.MobData_DamageSpeed(3)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(3), 1, Len(MainProgram.MobData_DamageSpeed(3)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(3), Len(MainProgram.MobData_DamageSpeed(3)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(3) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Four:/z " + MainProgram.MobData_DamageName(3))
                MainProgram.SND("/c*              Die:/z " + MainProgram.MobData_DamageDieNum(3) + "d" + MainProgram.MobData_DamageDieType(3))
                MainProgram.SND("/c*            Speed:/z " + trunspeed)
                MainProgram.SND("/c*             Type:/z " + MainProgram.MobData_DamageType(3))
                MainProgram.SND("/c*     Critical Hit:/z " + MainProgram.MobData_DamageCrit(3))
            ElseIf trunvar = 5 Then
                If Len(MainProgram.MobData_DamageSpeed(0)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(0), 1, Len(MainProgram.MobData_DamageSpeed(0)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(0), Len(MainProgram.MobData_DamageSpeed(0)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(0) + " Tenths of a Second"
                End If
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* mainprogram.Damage Type One:/z " + MainProgram.MobData_DamageName(0))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(0) + "d" + MainProgram.MobData_DamageDieType(0))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(0))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(0))
                If Len(MainProgram.MobData_DamageSpeed(1)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(1), 1, Len(MainProgram.MobData_DamageSpeed(1)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(1), Len(MainProgram.MobData_DamageSpeed(1)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(1) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Two:/z " + MainProgram.MobData_DamageName(1))
                MainProgram.SND("/c*             Die:/z " + MainProgram.MobData_DamageDieNum(1) + "d" + MainProgram.MobData_DamageDieType(1))
                MainProgram.SND("/c*           Speed:/z " + trunspeed)
                MainProgram.SND("/c*            Type:/z " + MainProgram.MobData_DamageType(1))
                MainProgram.SND("/c*    Critical Hit:/z " + MainProgram.MobData_DamageCrit(1))
                If Len(MainProgram.MobData_DamageSpeed(2)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(2), 1, Len(MainProgram.MobData_DamageSpeed(2)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(2), Len(MainProgram.MobData_DamageSpeed(2)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(2) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Three:/z " + MainProgram.MobData_DamageName(2))
                MainProgram.SND("/c*               Die:/z " + MainProgram.MobData_DamageDieNum(2) + "d" + MainProgram.MobData_DamageDieType(2))
                MainProgram.SND("/c*             Speed:/z " + trunspeed)
                MainProgram.SND("/c*              Type:/z " + MainProgram.MobData_DamageType(2))
                MainProgram.SND("/c*      Critical Hit:/z " + MainProgram.MobData_DamageCrit(2))
                If Len(MainProgram.MobData_DamageSpeed(3)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(3), 1, Len(MainProgram.MobData_DamageSpeed(3)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(3), Len(MainProgram.MobData_DamageSpeed(3)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(3) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Four:/z " + MainProgram.MobData_DamageName(3))
                MainProgram.SND("/c*              Die:/z " + MainProgram.MobData_DamageDieNum(3) + "d" + MainProgram.MobData_DamageDieType(3))
                MainProgram.SND("/c*            Speed:/z " + trunspeed)
                MainProgram.SND("/c*             Type:/z " + MainProgram.MobData_DamageType(3))
                MainProgram.SND("/c*     Critical Hit:/z " + MainProgram.MobData_DamageCrit(3))
                If Len(MainProgram.MobData_DamageSpeed(4)) > 1 Then
                    trunspeed = Mid(MainProgram.MobData_DamageSpeed(4), 1, Len(MainProgram.MobData_DamageSpeed(4)) - 1) + "." + Mid(MainProgram.MobData_DamageSpeed(4), Len(MainProgram.MobData_DamageSpeed(4)), 1) + " Seconds"
                Else
                    trunspeed = MainProgram.MobData_DamageSpeed(4) + " Tenths of a Second"
                End If
                MainProgram.SND("/c* mainprogram.Damage Type Five:/z " + MainProgram.MobData_DamageName(4))
                MainProgram.SND("/c*              Die:/z " + MainProgram.MobData_DamageDieNum(4) + "d" + MainProgram.MobData_DamageDieType(4))
                MainProgram.SND("/c*            Speed:/z " + trunspeed)
                MainProgram.SND("/c*             Type:/z " + MainProgram.MobData_DamageType(4))
                MainProgram.SND("/c*     Critical Hit:/z " + MainProgram.MobData_DamageCrit(4))
            End If
            MainProgram.SND("/c***********************************************")
            MainProgram.SND("/c* /cDialogue MainProgram.script #:/z " + MainProgram.MobData_SCRIT)
            MainProgram.SND("/c*/C**********************************************")
        Else
            MainProgram.SND("/RERROR: mainprogram.mob doesn't exist (/z" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) + "/R)")
        End If
    End Sub
    Private Sub CMD_prev_loaditem(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        MainProgram.ItemData = MainProgram.GetFileContents(MainProgram.DirItems, MainProgram.sErr)
        Dim tmp0 As Integer, tmp1 As Integer = Val(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))), tmpA As String = ""
        For tmp0 = InStr(MainProgram.ItemData, "TOTAL#") To Len(MainProgram.ItemData) Step 1
            If Mid(MainProgram.ItemData, tmp0, 1) = "(" Then
                tmpA = Mid(MainProgram.ItemData, InStr(MainProgram.ItemData, "TOTAL#") + 6, tmp0 - 6 - InStr(MainProgram.ItemData, "TOTAL#"))
                Exit For
            End If
        Next
        If tmp1 <= Val(tmpA) Then
            LoadItem.LoadItem(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
            MainProgram.SND("/gloadingitem...")
            If MainProgram.ItemData_BasicType = "Miscellaneous" Then
                MainProgram.SND("/c*/C**********************************************")
                MainProgram.SND("/c* /CItem Number: /c" + MainProgram.ItemData_VIRID + "/" + tmpA)
                MainProgram.SND("/c*/C**********************************************")
                MainProgram.SND("/c* Base Type: /zMiscellaneous")
                MainProgram.SND("/c* Name:/z " + MainProgram.ItemData_ITEMN)
                MainProgram.SND("/c* Short:/z " + MainProgram.ItemData_SHORT)
                MainProgram.SND("/c* Look:/z " + MainProgram.ItemData_LOOKD)
                MainProgram.SND("/c* Long:/z " + MainProgram.ItemData_LONGD)
                MainProgram.SND("/c* Category:/z " + MainProgram.ItemData_ITEMC)
                Dim ITEMTstring As String = ""
                If MainProgram.ItemData_ITEMT = "0" Then
                    ITEMTstring = "Static Environmental Prop"
                ElseIf MainProgram.ItemData_ITEMT = "1" Then
                    ITEMTstring = "Static Environmental Bag"
                ElseIf MainProgram.ItemData_ITEMT = "2" Then
                    ITEMTstring = "Dynamic Environmental Prop"
                ElseIf MainProgram.ItemData_ITEMT = "3" Then
                    ITEMTstring = "Dynamic Environmental Prop High Respawn"
                ElseIf MainProgram.ItemData_ITEMT = "4" Then
                    ITEMTstring = "Dynamic Environmental Bag"
                ElseIf MainProgram.ItemData_ITEMT = "5" Then
                    ITEMTstring = "Static Regular Item"
                ElseIf MainProgram.ItemData_ITEMT = "6" Then
                    ITEMTstring = "Money"
                End If
                MainProgram.SND("/c* Item Type:/z " + ITEMTstring)
                MainProgram.SND("/c* Weight:/z " + MainProgram.ItemData_Weight)
                MainProgram.SND("/c* Purchasable Area:/z " + MainProgram.ItemData_PurchasableAreas)
                MainProgram.SND("/c* Worth:/z " + MainProgram.ItemData_Worth)
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* Required Sex:/z " + MainProgram.ItemData_SexRequirement)
                MainProgram.SND("/c* Required Level:/z " + MainProgram.ItemData_LevelRequirement)
                MainProgram.SND("/c* Required Class:/z " + MainProgram.ItemData_ClassRequirement)
                MainProgram.SND("/c*/C**********************************************")
            ElseIf MainProgram.ItemData_BasicType = "Armor" Then
                MainProgram.SND("/c*/C**********************************************")
                MainProgram.SND("/c* /CItem Number: /c" + MainProgram.ItemData_VIRID + "/" + tmpA)
                MainProgram.SND("/c*/C**********************************************")
                MainProgram.SND("/c* Base Type: /zArmor")
                MainProgram.SND("/c* Name:/z " + MainProgram.ItemData_ITEMN)
                MainProgram.SND("/c* Look:/z " + MainProgram.ItemData_LOOKD)
                MainProgram.SND("/c* Long:/z " + MainProgram.ItemData_LONGD)
                MainProgram.SND("/c* Category:/z " + MainProgram.ItemData_ITEMC)
                MainProgram.SND("/c* Armor Type:/z " + MainProgram.ItemData_ProfReq)
                MainProgram.SND("/c* Item Type:/z " + MainProgram.ItemData_ITEMT)
                MainProgram.SND("/c* Quality:/z " + MainProgram.ItemData_Quality)
                MainProgram.SND("/c* Material:/z " + MainProgram.ItemData_Material)
                MainProgram.SND("/c* Weight:/z " + MainProgram.ItemData_Weight)
                MainProgram.SND("/c* Craftsmanship:/z " + MainProgram.ItemData_Craftsmanship)
                MainProgram.SND("/c* Durability:/z " + MainProgram.ItemData_DurabilityCount)
                MainProgram.SND("/c* Material Strength:/z " + MainProgram.ItemData_DurabilityPerc + "%")
                MainProgram.SND("/c* Bash AC:/z " + MainProgram.ItemData_BashAC)
                MainProgram.SND("/c* Slash AC:/z " + MainProgram.ItemData_SlashAC)
                MainProgram.SND("/c* Pierce AC:/z " + MainProgram.ItemData_PierceAC)
                MainProgram.SND("/c* Fist AC:/z " + MainProgram.ItemData_FistAC)
                MainProgram.SND("/c* Exotic AC:/z " + MainProgram.ItemData_ExoticAC)
                MainProgram.SND("/c* Affect1:/z " + MainProgram.ItemData_Affect1)
                MainProgram.SND("/c* Affect2:/z " + MainProgram.ItemData_Affect2)
                MainProgram.SND("/c* Purchasable Area:/z " + MainProgram.ItemData_PurchasableAreas)
                MainProgram.SND("/c* Worth:/z " + MainProgram.ItemData_Worth)
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* Required Sex:/z " + MainProgram.ItemData_SexRequirement)
                MainProgram.SND("/c* Required Level:/z " + MainProgram.ItemData_LevelRequirement)
                MainProgram.SND("/c* Required Class:/z " + MainProgram.ItemData_ClassRequirement)
                MainProgram.SND("/c*/C**********************************************")
            ElseIf MainProgram.ItemData_BasicType = "Weapon" Then
                MainProgram.SND("/c*/C**********************************************")
                MainProgram.SND("/c* /CItem Number: /c" + MainProgram.ItemData_VIRID + "/" + tmpA)
                MainProgram.SND("/c*/C**********************************************")
                MainProgram.SND("/c* Base Type: /zWeapon")
                MainProgram.SND("/c* Name:/z " + MainProgram.ItemData_ITEMN)
                MainProgram.SND("/c* Look:/z " + MainProgram.ItemData_LOOKD)
                MainProgram.SND("/c* Long:/z " + MainProgram.ItemData_LONGD)
                MainProgram.SND("/c* Category:/z " + MainProgram.ItemData_ITEMC)
                MainProgram.SND("/c* Weapon Type:/z " + MainProgram.ItemData_TYPE)
                MainProgram.SND("/c* Item Type:/z " + MainProgram.ItemData_ITEMT)
                MainProgram.SND("/c* Quality:/z " + MainProgram.ItemData_Quality)
                MainProgram.SND("/c* Material:/z " + MainProgram.ItemData_Material)
                MainProgram.SND("/c* Weight:/z " + MainProgram.ItemData_Weight)
                MainProgram.SND("/c* Craftsmanship:/z " + MainProgram.ItemData_Craftsmanship)
                MainProgram.SND("/c* Durability:/z " + MainProgram.ItemData_DurabilityCount)
                MainProgram.SND("/c* Material Strength:/z " + MainProgram.ItemData_DurabilityPerc + "%")
                MainProgram.SND("/c* Two Handed:/z " + MainProgram.ItemData_2Handed)
                MainProgram.SND("/c* Area Of Affect:/z " + MainProgram.ItemData_AreaOfAffect)
                MainProgram.SND("/c* mainprogram.Damage Die:/z " + MainProgram.ItemData_DamageDie + "d" + MainProgram.ItemData_DamageDieTypee + "+" + MainProgram.ItemData_DamagePlus)
                MainProgram.SND("/c* mainprogram.Damage Type:/z " + MainProgram.ItemData_DamageType)
                MainProgram.SND("/c* Affect One:/z " + MainProgram.ItemData_Affect1)
                MainProgram.SND("/c* Affect Two:/z " + MainProgram.ItemData_Affect2)
                MainProgram.SND("/c* Purchasable Area:/z " + MainProgram.ItemData_PurchasableAreas)
                MainProgram.SND("/c* Worth:/z " + MainProgram.ItemData_Worth)
                MainProgram.SND("/c***********************************************")
                MainProgram.SND("/c* Required Sex:/z " + MainProgram.ItemData_SexRequirement)
                MainProgram.SND("/c* Required Level:/z " + MainProgram.ItemData_LevelRequirement)
                MainProgram.SND("/c* Required Class:/z " + MainProgram.ItemData_ClassRequirement)
                MainProgram.SND("/c*/C**********************************************")
            End If
        Else
            MainProgram.SND("/RERROR: Item doesn't exist (/z" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) + "/R)")
        End If
    End Sub
    Private Sub CMD_prev_loadsector(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        MainProgram.MapData = MainProgram.GetFileContents(MainProgram.DirMaps, MainProgram.sErr)
        Dim tmp0 As Integer, tmp1 As Integer = Val(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))), tmpA As String = ""
        For tmp0 = InStr(MainProgram.MapData, "TOTAL#") To Len(MainProgram.MapData) Step 1
            If Mid(MainProgram.MapData, tmp0, 1) = "(" Then
                tmpA = Mid(MainProgram.MapData, InStr(MainProgram.MapData, "TOTAL#") + 6, tmp0 - 6 - InStr(MainProgram.MapData, "TOTAL#"))
                Exit For
            End If
        Next
        If tmp1 <= Val(tmpA) Then
            LoadSector.LoadSector(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))), False)
            MainProgram.SND("/c*/C**********************************************")
            MainProgram.SND("/c* /CSector Number: /c" + LTrim(Str(tmp1)) + "/" + tmpA)
            MainProgram.SND("/c*/C**********************************************")
            MainProgram.SND("/c* World      :/z " + MainProgram.UserLocation_WorldString)
            MainProgram.SND("/c* Continent  :/z " + MainProgram.UserLocation_ContinentString)
            MainProgram.SND("/c* Province   :/z " + MainProgram.UserLocation_ProvinceString)
            MainProgram.SND("/c* Area       :/z " + MainProgram.UserLocation_AreaString)
            MainProgram.SND("/c* Map        :/z " + MainProgram.UserLocation_MapString)
            MainProgram.SND("/c* Sector     :/z " + MainProgram.UserLocation_SectorString)
            MainProgram.SND("/c* Environment:/z " + MainProgram.MapData_EnvironString)
            MainProgram.SND("/c* Accessible :/z " + Str(MainProgram.UserLocation_Accessible))
            MainProgram.SND("/c***********************************************")
            If MainProgram.MapData_SECTD <> "" Then MainProgram.SND("/c* Description:/z " + MainProgram.MapData_SECTD) Else MainProgram.SND("/c* Description: /zNone")
            If MainProgram.MapData_CCHAR <> "" Then MainProgram.SND("/c* Current Characters:/z " + MainProgram.MapData_CCHAR) Else MainProgram.SND("/c* Current Characters: /zNone")
            If MainProgram.MapData_CurrentMobs <> "" Then MainProgram.SND("/c* Current Character Flags:/z " + Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.MapData_CurrentMobs, "]A ", "]"), "]An ", "]"), "]The ", "]"), " A ", ""), " An ", ""), " The ", "")) Else MainProgram.SND("/c* Current Characters Loaded: /zNone")
            If MainProgram.MapData_STATC <> "" Then MainProgram.SND("/c* Current Props:/z " + MainProgram.MapData_STATC) Else MainProgram.SND("/c* Current Props: /zNone")
            If MainProgram.MapData_CurrentProps <> "" Then MainProgram.SND("/c* Current Props Loaded:/z " + MainProgram.MapData_CurrentProps) Else MainProgram.SND("/c* Current Props Loaded: /zNone")
            If MainProgram.MapData_DRTEM <> "" Then MainProgram.SND("/c* Dropped Items:/z " + MainProgram.MapData_DRTEM) Else MainProgram.SND("/c* Dropped Items: /zNone")
            MainProgram.SND("/c***********************************************")
            If MainProgram.UserLocation_WestCNCT > 0 Then
                MainProgram.SND("/c* West Connection: /zOpen - " + Str(MainProgram.UserLocation_WestCNCT))
            Else
                MainProgram.SND("/c* West Connection: /zNone")
            End If
            If MainProgram.UserLocation_EastCNCT > 0 Then
                MainProgram.SND("/c* East Connection: /zOpen - " + Str(MainProgram.UserLocation_EastCNCT))
            Else
                MainProgram.SND("/c* East Connection: /zNone")
            End If
            If MainProgram.UserLocation_NorthCNCT > 0 Then
                MainProgram.SND("/c* North Connection: /zOpen - " + Str(MainProgram.UserLocation_NorthCNCT))
            Else
                MainProgram.SND("/c* North Connection: /zNone")
            End If
            If MainProgram.UserLocation_SouthCNCT > 0 Then
                MainProgram.SND("/c* South Connection: /zOpen - " + Str(MainProgram.UserLocation_SouthCNCT))
            Else
                MainProgram.SND("/c* South Connection: /zNone")
            End If
            If MainProgram.UserLocation_UpCNCT > 0 Then
                MainProgram.SND("/c* Up Connection: /zOpen - " + Str(MainProgram.UserLocation_UpCNCT))
            Else
                MainProgram.SND("/c* Up Connection: /zNone")
            End If
            If MainProgram.UserLocation_DownCNCT > 0 Then
                MainProgram.SND("/c* Down Connection: /zOpen - " + Str(MainProgram.UserLocation_DownCNCT))
            Else
                MainProgram.SND("/c* Down Connection : /zNone")
            End If
            MainProgram.SND("/c*/C**********************************************")
            Dim testline As Boolean = False
            If MainProgram.Dialogue(0) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 1: /z" + MainProgram.Dialogue(0))
                testline = True
            End If
            If MainProgram.Dialogue(1) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 2: /z" + MainProgram.Dialogue(1))
                testline = True
            End If
            If MainProgram.Dialogue(2) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 3: /z" + MainProgram.Dialogue(2))
                testline = True
            End If
            If MainProgram.Dialogue(3) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 4: /z" + MainProgram.Dialogue(3))
                testline = True
            End If
            If MainProgram.Dialogue(4) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 5: /z" + MainProgram.Dialogue(4))
                testline = True
            End If
            If MainProgram.Dialogue(5) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 6: /z" + MainProgram.Dialogue(5))
                testline = True
            End If
            If MainProgram.Dialogue(6) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 7: /z" + MainProgram.Dialogue(6))
                testline = True
            End If
            If MainProgram.Dialogue(7) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 8: /z" + MainProgram.Dialogue(7))
                testline = True
            End If
            If MainProgram.Dialogue(8) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 9: /z" + MainProgram.Dialogue(8))
                testline = True
            End If
            If MainProgram.Dialogue(9) <> "" Then
                MainProgram.SND("/c* MainProgram.dialogue 10: /z" + MainProgram.Dialogue(9))
                testline = True
            End If
            If testline = True Then
                MainProgram.SND("/c*/C**********************************************")
            End If
        Else
            MainProgram.SND("/RERROR: Sector doesn't exist (/z" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) + "/R)")
        End If
    End Sub
#End Region
#Region "Game Master Commands"
    Private Sub CMD_gm_gologin(ByVal txt As String, ByVal nputlen As Short)
        MainProgram.SND("/gA skinny old man perks his head up as you step up to the nexus.")
        MainProgram.SND("/wThe skinny old man - /G" + Chr(34) + "/gWho's there?/G" + Chr(34))
        MainProgram.SND("/w[Enter Your Character Name to Begin]")
        MainProgram.State = "LoginName"
        MainProgram.User_Name = "Lythantos"
        MainProgram.User_Password = "N/A"
        MainProgram.UserPasswordLastTry = False
        txt = ""
        MainProgram.NewPlayer = False
    End Sub
    Private Sub CMD_gm_goto(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If InStr(MainProgram.MapData, "VIRID#" + tmpa + "(") Then
            LoadSector.LoadSector(tmpa, 1)
            MainProgram.SND("/YTeleported to Sector /z-> /g" + tmpa)
        Else
            MainProgram.SND("/rCould not teleport, doesn't exist: " + tmpa)
        End If
    End Sub
    Private Sub CMD_server_put(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) 'file specified to be downloaded
        Dim SeparatePos As Integer = 0
        Dim StringPart(1) As String
        If InStr(tmpa, " ") = False Then
            MainProgram.SND("/RNot enough variables.")
            MainProgram.SND("/g    Usage: /y!server_put $fileloc|name $serverfileloc|name")
            MainProgram.SND("/g           rootserverdir='/plainsofsedia/")
            Exit Sub
        End If
        For SeparatePos = 1 To Len(tmpa) Step 1
            If Mid(tmpa, SeparatePos, 1) = " " Then
                StringPart(0) = LTrim(RTrim(Mid(tmpa, 1, SeparatePos)))
                StringPart(1) = LTrim(RTrim(Mid(tmpa, SeparatePos, Len(tmpa))))
                If Len(StringPart(0)) = 0 Or Len(StringPart(1)) = 0 Then
                    MainProgram.SND("/RNot enough variables.")
                    MainProgram.SND("/g    Usage: /y!server_put $fileloc|name $serverfileloc|name")
                    MainProgram.SND("/g           rootserverdir='/plainsofsedia/")
                    Exit Sub
                Else
                    MainProgram.SND("/yAttempting to put /g" + Replace(MainProgram.ResourcesDir + StringPart(0), "/", "|") + " /Y@/y" + Replace("ftp://ftp.toes.0sites.org/plainsofsedia/" + StringPart(1), "/", "|"))
                End If
                Exit For
            End If
        Next
        Try
            Dim fwr As FtpWebRequest = DirectCast(WebRequest.Create("ftp://ftp.toes.0sites.org/plainsofsedia/" + Replace(StringPart(1), "\", "/")), FtpWebRequest) 'make sure to replace \ with / since we're uploading
            fwr.Credentials = New NetworkCredential("5v3nd0ttg@toes.0sites.org", "p3n3l0py")
            fwr.Method = WebRequestMethods.Ftp.UploadFile
            Dim clsStream As System.IO.Stream = fwr.GetRequestStream()
            Dim bFile() As Byte = System.IO.File.ReadAllBytes(MainProgram.ResourcesDir + Replace(StringPart(0), "/", "\")) 'filename & location, ensure \ is used instead of / since it can be confusing at times
            clsStream.Write(bFile, 0, bFile.Length)
            clsStream.Close()
            clsStream.Dispose()
            fwr = Nothing
            MainProgram.SND("/GPut was successful!")
        Catch errorvariable As Exception 'just incase file is corrupt or missing
            MainProgram.SND("/RERROR: " + errorvariable.ToString())
        End Try
    End Sub
    Private Sub CMD_server_del(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) 'file specified to be downloaded
        Try
            Dim fwr As FtpWebRequest = DirectCast(WebRequest.Create("ftp://ftp.toes.0sites.org/plainsofsedia/" + Replace(tmpa, "\", "/")), FtpWebRequest) 'make sure to replace \ with / since we're uploading
            fwr.Credentials = New NetworkCredential("5v3nd0ttg@toes.0sites.org", "p3n3l0py")
            fwr.Method = WebRequestMethods.Ftp.DeleteFile
            Dim response As FtpWebResponse = fwr.GetResponse
            fwr = Nothing
            MainProgram.SND("/yYou deleted /g" + Replace(tmpa, "\", "/") + "/Y@/y" + Replace("ftp://ftp.toes.0sites.org/plainsofsedia/" + Replace(tmpa, "\", "/"), "/", "|") + "/y.")
        Catch errorvariable As Exception 'just incase file is corrupt or missing
            MainProgram.SND("/RERROR: " + errorvariable.ToString())
        End Try
    End Sub
    Private Sub CMD_server_dir(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        'this command will attempt a connection to the website ftp and if established print all files and directories specified
        'by the directory queried (tmpa) so that "." would be the root directory, and "plainsofsedia" would be the
        'root/plainsofsedia and so on. if there are any errors then those are displayed in bright red so they can be
        'reported.
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) 'file specified to be downloaded
        If tmpa = "." Then tmpa = ""
        Try
            Dim fwr As FtpWebRequest = FtpWebRequest.Create("ftp://ftp.toes.0sites.org/plainsofsedia/" + Replace(tmpa, "\", "/"))
            fwr.Credentials = New NetworkCredential("5v3nd0ttg@toes.0sites.org", "p3n3l0py")
            fwr.Method = WebRequestMethods.Ftp.ListDirectory
            Dim sr As New StreamReader(fwr.GetResponse().GetResponseStream())
            Dim file(0) As String 'file array
            Dim Curfile As Integer
            Dim str As String = sr.ReadLine()
            While Not str Is Nothing
                If InStr(str, ".") = False Or str = "." Or str = ".." Then
                    str = "/Y" + str  'color code files
                    MainProgram.SND(str)
                Else
                    file(file.Length - 1) = "/y" + str
                    Array.Resize(file, file.Length + 1)
                End If
                str = sr.ReadLine()
            End While
            For Curfile = 0 To file.Length - 1 Step 1
                MainProgram.SND(file(Curfile))
            Next
            sr.Close()
            sr = Nothing
            fwr = Nothing
        Catch errorvariable As Exception 'just incase file is corrupt or missing
            MainProgram.SND("/RERROR: " + errorvariable.ToString())
        End Try
    End Sub
    Private Sub CMD_server_get(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        'this function retrieves the latest updated database file depending on the file specified
        'to be grabbed by the MainProgram.User (tmpa) and then replaces the local file(s) with the file(s) grabbed
        'from the server [google code svn repository] right now this is a manual file get system which
        'will be updated with an automatic one later on.
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))) 'file specified to be downloaded
        Dim filename(69) As String 'you can grab 50 files at a time
        Dim filelocation(69) As String
        Dim filenumber As Byte = 70 'there are 70 total file types in base dir
        Dim CurNumber As Short = 0
        If tmpa = "base.dir" Then 'Resources/Databases - Everything in database is downloaded
            filename(0) = "Abilities.xml"
            filelocation(0) = "Databases/Abilities/"
            filename(1) = "Abilities.xml"
            filelocation(1) = "Databases/Abilities/"
            filename(2) = "Elementalist.xml"
            filelocation(2) = "Databases/Classes/"
            filename(3) = "Gravedigger.xml"
            filelocation(3) = "Databases/Classes/"
            filename(4) = "Headhunter.xml"
            filelocation(4) = "Databases/Classes/"
            filename(5) = "Hermit.xml"
            filelocation(5) = "Databases/Classes/"
            filename(6) = "Mageling.xml"
            filelocation(6) = "Databases/Classes/"
            filename(7) = "Minstrel.xml"
            filelocation(7) = "Databases/Classes/"
            filename(8) = "Monk.xml"
            filelocation(8) = "Databases/Classes/"
            filename(9) = "Page.xml"
            filelocation(9) = "Databases/Classes/"
            filename(10) = "Pickpocket.xml"
            filelocation(10) = "Databases/Classes/"
            filename(11) = "Plainsman.xml"
            filelocation(11) = "Databases/Classes/"
            filename(12) = "Priest.xml"
            filelocation(12) = "Databases/Classes/"
            filename(13) = "Runescribe.xml"
            filelocation(13) = "Databases/Classes/"
            filename(14) = "Scout.xml"
            filelocation(14) = "Databases/Classes/"
            filename(15) = "Woodsman.xml"
            filelocation(15) = "Databases/Classes/"
            filename(16) = "Emotes.xml"
            filelocation(16) = "Databases/Emotes/"
            filename(17) = "ClayHelp.xml"
            filelocation(17) = "Databases/Help/"
            filename(18) = "ClayVersion.xml"
            filelocation(18) = "Databases/Help/"
            filename(19) = "Commands.xml"
            filelocation(19) = "Databases/Help/"
            filename(20) = "PLOSVersion.xml"
            filelocation(20) = "Databases/Help/"
            filename(21) = "TL.Alcoholic Beverages.xml"
            filelocation(21) = "Databases/Items/"
            filename(22) = "TL.Armor.xml"
            filelocation(22) = "Databases/Items/"
            filename(23) = "TL.Basic Forgin.xml"
            filelocation(23) = "Databases/Items/"
            filename(24) = "TL.Books.xml"
            filelocation(24) = "Databases/Items/"
            filename(25) = "TL.Bridles.xml"
            filelocation(25) = "Databases/Items/"
            filename(26) = "TL.Chemicals.xml"
            filelocation(26) = "Databases/Items/"
            filename(27) = "TL.Containers.xml"
            filelocation(27) = "Databases/Items/"
            filename(28) = "TL.Cooking Supplies.xml"
            filelocation(28) = "Databases/Items/"
            filename(29) = "TL.Fibers.xml"
            filelocation(29) = "Databases/Items/"
            filename(30) = "TL.Food.xml"
            filelocation(30) = "Databases/Items/"
            filename(31) = "TL.Furniture.xml"
            filelocation(31) = "Databases/Items/"
            filename(32) = "TL.Gambling.xml"
            filelocation(32) = "Databases/Items/"
            filename(33) = "TL.Harvestable Food.xml"
            filelocation(33) = "Databases/Items/"
            filename(34) = "TL.Herbs And Reagents.xml"
            filelocation(34) = "Databases/Items/"
            filename(35) = "TL.Hunting Supplies.xml"
            filelocation(35) = "Databases/Items/"
            filename(36) = "TL.Index.xml"
            filelocation(36) = "Databases/Items/"
            filename(37) = "TL.Instruments.xml"
            filelocation(37) = "Databases/Items/"
            filename(38) = "TL.Kits.xml"
            filelocation(38) = "Databases/Items/"
            filename(39) = "TL.Leathercrafting.xml"
            filelocation(39) = "Databases/Items/"
            filename(40) = "TL.Lights.xml"
            filelocation(40) = "Databases/Items/"
            filename(41) = "TL.Living Charters.xml"
            filelocation(41) = "Databases/Items/"
            filename(42) = "TL.Magical Items.xml"
            filelocation(42) = "Databases/Items/"
            filename(43) = "TL.Maps.xml"
            filelocation(43) = "Databases/Items/"
            filename(44) = "TL.Medical Supplies.xml"
            filelocation(44) = "Databases/Items/"
            filename(45) = "TL.Molds, Patterns, And Designs.xml"
            filelocation(45) = "Databases/Items/"
            filename(46) = "TL.Ores & Raw Gems.xml"
            filelocation(46) = "Databases/Items/"
            filename(47) = "TL.Outfits.xml"
            filelocation(47) = "Databases/Items/"
            filename(48) = "TL.Packs.xml"
            filelocation(48) = "Databases/Items/"
            filename(49) = "TL.Pets.xml"
            filelocation(49) = "Databases/Items/"
            filename(50) = "TL.Pipes.xml"
            filelocation(50) = "Databases/Items/"
            filename(51) = "TL.Potions And Magical Applicants.xml"
            filelocation(51) = "Databases/Items/"
            filename(52) = "TL.Rock Climbing.xml"
            filelocation(52) = "Databases/Items/"
            filename(53) = "TL.Scabbard.xml"
            filelocation(53) = "Databases/Items/"
            filename(54) = "TL.Soaps.xml"
            filelocation(54) = "Databases/Items/"
            filename(55) = "TL.Tailoring.xml"
            filelocation(55) = "Databases/Items/"
            filename(56) = "TL.Tents.xml"
            filelocation(56) = "Databases/Items/"
            filename(57) = "TL.Thievary Tools.xml"
            filelocation(57) = "Databases/Items/"
            filename(58) = "TL.Tools.xml"
            filelocation(58) = "Databases/Items/"
            filename(59) = "TL.Torture.xml"
            filelocation(59) = "Databases/Items/"
            filename(60) = "TL.Transportation.xml"
            filelocation(60) = "Databases/Items/"
            filename(61) = "TL.Treasure.xml"
            filelocation(61) = "Databases/Items/"
            filename(62) = "TL.Trinkets.xml"
            filelocation(62) = "Databases/Items/"
            filename(63) = "TL.Weapons.xml"
            filelocation(63) = "Databases/Items/"
            filename(64) = "TL.Woodblocks And Applicants.xml"
            filelocation(64) = "Databases/Items/"
            filename(65) = "Items.xml"
            filelocation(65) = "Databases/Items/"
            filename(66) = "ML.Materials.xml"
            filelocation(66) = "Databases/Items/"
            filename(67) = "Mobs.xml"
            filelocation(67) = "Databases/Mobiles/"
            filename(68) = "Scripts.TG"
            filelocation(68) = "Databases/Mobiles/"
            filename(69) = "TL.Creatures.xml"
            filelocation(69) = "Databases/Mobiles/"
            filenumber = 70
        ElseIf tmpa = "dir.abilities" Then 'Resources/Databases/Abilities - All Abilities
            filename(0) = "Abilities.xml"
            filelocation(0) = "Databases/Abilities/"
            filenumber = 1
        ElseIf tmpa = "elementalist" Then 'Resources/Databases/Classes
            filename(0) = "Elementalist.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "gravedigger" Then 'Resources/Databases/Classes
            filename(0) = "Gravedigger.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "headhunter" Then 'Resources/Databases/Classes
            filename(0) = "Headhunter.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "hermit" Then 'Resources/Databases/Classes
            filename(0) = "Hermit.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "mageling" Then 'Resources/Databases/Classes
            filename(0) = "Mageling.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "minstrel" Then 'Resources/Databases/Classes
            filename(0) = "Minstrel.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "monk" Then 'Resources/Databases/Classes
            filename(0) = "Monk.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "page" Then 'Resources/Databases/Classes
            filename(0) = "Page.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "pickpocket" Then 'Resources/Databases/Classes
            filename(0) = "Pickpocket.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "plainsman" Then 'Resources/Databases/Classes
            filename(0) = "Plainsman.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "priest" Then 'Resources/Databases/Classes
            filename(0) = "Priest.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "runescribe" Then 'Resources/Databases/Classes
            filename(0) = "Runescribe.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "scout" Then 'Resources/Databases/Classes
            filename(0) = "Scout.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "woodsman" Then 'Resources/Databases/Classes
            filename(0) = "Woodsman.xml"
            filelocation(0) = "Databases/Classes/"
            filenumber = 1
        ElseIf tmpa = "dir.classes" Then 'Resources/Databases/Classes - All Classes
            filename(0) = "Abilities.xml"
            filelocation(0) = "Databases/Abilities/"
            filename(1) = "Elementalist.xml"
            filelocation(1) = "Databases/Classes/"
            filename(2) = "Gravedigger.xml"
            filelocation(2) = "Databases/Classes/"
            filename(3) = "Headhunter.xml"
            filelocation(3) = "Databases/Classes/"
            filename(4) = "Hermit.xml"
            filelocation(4) = "Databases/Classes/"
            filename(5) = "Mageling.xml"
            filelocation(5) = "Databases/Classes/"
            filename(6) = "Minstrel.xml"
            filelocation(6) = "Databases/Classes/"
            filename(7) = "Monk.xml"
            filelocation(7) = "Databases/Classes/"
            filename(8) = "Page.xml"
            filelocation(8) = "Databases/Classes/"
            filename(9) = "Pickpocket.xml"
            filelocation(9) = "Databases/Classes/"
            filename(10) = "Plainsman.xml"
            filelocation(10) = "Databases/Classes/"
            filename(11) = "Priest.xml"
            filelocation(11) = "Databases/Classes/"
            filename(12) = "Runescribe.xml"
            filelocation(12) = "Databases/Classes/"
            filename(13) = "Scout.xml"
            filelocation(13) = "Databases/Classes/"
            filename(14) = "Woodsman.xml"
            filelocation(14) = "Databases/Classes/"
            filenumber = 15
        ElseIf tmpa = "dir.emotes" Then 'Resources/Databases/Emotes - All Emotes
            filename(0) = "Emotes.xml"
            filelocation(0) = "Databases/Emotes/"
            filenumber = 1
        ElseIf tmpa = "clayhelp" Then 'Resources/Databases/Help
            filename(0) = "ClayHelp.xml"
            filelocation(0) = "Databases/Help/"
            filenumber = 1
        ElseIf tmpa = "clayversion" Then 'Resources/Databases/Help
            filename(0) = "ClayVersion.xml"
            filelocation(0) = "Databases/Help/"
            filenumber = 1
        ElseIf tmpa = "commands" Then 'Resources/Databases/Help
            filename(0) = "Commands.xml"
            filelocation(0) = "Databases/Help/"
            filenumber = 1
        ElseIf tmpa = "plosversion" Then 'Resources/Databases/Help
            filename(0) = "PLOSVersion.xml"
            filelocation(0) = "Databases/Help/"
            filenumber = 1
        ElseIf tmpa = "dir.help" Then 'Resources/Databases/Help - All Files in Help Dir
            filename(0) = "ClayHelp.xml"
            filelocation(0) = "Databases/Help/"
            filename(1) = "ClayVersion.xml"
            filelocation(1) = "Databases/Help/"
            filename(2) = "Commands.xml"
            filelocation(2) = "Databases/Help/"
            filename(3) = "PLOSVersion.xml"
            filelocation(3) = "Databases/Help/"
            filenumber = 4
        ElseIf tmpa = "items" Then 'Resources/Databases/Items
            filename(0) = "Items.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "ml.materials" Then  'Resources/Databases/Items
            filename(0) = "ML.Materials.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.alcoholic beverages" Then  'Resources/Databases/Items
            filename(0) = "TL.Alcoholic Beverages.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.armor" Then 'Resources/Databases/Items
            filename(0) = "TL.Armor.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.basic forging" Then  'Resources/Databases/Items
            filename(0) = "TL.Basic Forgin.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.books" Then  'Resources/Databases/Items
            filename(0) = "TL.Books.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.bridles" Then  'Resources/Databases/Items
            filename(0) = "TL.Bridles.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.chemicals" Then  'Resources/Databases/Items
            filename(0) = "TL.Chemicals.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.containers" Then  'Resources/Databases/Items
            filename(0) = "TL.Containers.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.cooking supplies" Then  'Resources/Databases/Items
            filename(0) = "TL.Cooking Supplies.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.fibers" Then  'Resources/Databases/Items
            filename(0) = "TL.Fibers.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.food" Then  'Resources/Databases/Items
            filename(0) = "TL.Food.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.furniture" Then  'Resources/Databases/Items
            filename(0) = "TL.Furniture.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.gambling" Then  'Resources/Databases/Items
            filename(0) = "TL.Gambling.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.harvestable food" Then  'Resources/Databases/Items
            filename(0) = "TL.Harvestable Food.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.herbs and reagents" Then  'Resources/Databases/Items
            filename(0) = "TL.Herbs And Reagents.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.hunting supplies" Then  'Resources/Databases/Items
            filename(0) = "TL.Hunting Supplies.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.index" Then  'Resources/Databases/Items
            filename(0) = "TL.Index.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.instruments" Then  'Resources/Databases/Items
            filename(0) = "TL.Instruments.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.kits" Then  'Resources/Databases/Items
            filename(0) = "TL.Kits.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.leathercrafting" Then  'Resources/Databases/Items
            filename(0) = "TL.Leathercrafting.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.lights" Then  'Resources/Databases/Items
            filename(0) = "TL.Lights.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.living charters" Then  'Resources/Databases/Items
            filename(0) = "TL.Living Charters.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.magical items" Then  'Resources/Databases/Items
            filename(0) = "TL.Magical Items.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.maps" Then  'Resources/Databases/Items
            filename(0) = "TL.Maps.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.medical supplies" Then  'Resources/Databases/Items
            filename(0) = "TL.Medical Supplies.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.molds, patterns, and designs" Then  'Resources/Databases/Items
            filename(0) = "TL.Molds, Patterns, And Designs.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.ores & raw gems" Then  'Resources/Databases/Items
            filename(0) = "TL.Ores & Raw Gems.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.outfits" Then  'Resources/Databases/Items
            filename(0) = "TL.Outfits.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.packs" Then  'Resources/Databases/Items
            filename(0) = "TL.Packs.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.pets" Then  'Resources/Databases/Items
            filename(0) = "TL.Pets.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.pipes" Then  'Resources/Databases/Items
            filename(0) = "TL.Pipes.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.potions and magical applicants" Then  'Resources/Databases/Items
            filename(0) = "TL.Potions And Magical Applicants.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.rock climbing" Then  'Resources/Databases/Items
            filename(0) = "TL.Rock Climbing.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.scabbard" Then  'Resources/Databases/Items
            filename(0) = "TL.Scabbard.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.soaps" Then  'Resources/Databases/Items
            filename(0) = "TL.Soaps.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.tailoring" Then 'Resources/Databases/Items
            filename(0) = "TL.Tailoring.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.tents" Then  'Resources/Databases/Items
            filename(0) = "TL.Tents.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.thievary tools" Then  'Resources/Databases/Items
            filename(0) = "TL.Thievary Tools.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.tools" Then  'Resources/Databases/Items
            filename(0) = "TL.Tools.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.torture" Then  'Resources/Databases/Items
            filename(0) = "TL.Torture.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.transportation" Then  'Resources/Databases/Items
            filename(0) = "TL.Transportation.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.treasure" Then  'Resources/Databases/Items
            filename(0) = "TL.Treasure.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.trinkets" Then  'Resources/Databases/Items
            filename(0) = "TL.Trinkets.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.weapons" Then  'Resources/Databases/Items
            filename(0) = "TL.Weapons.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "tl.woodblocks and applicants" Then  'Resources/Databases/Items
            filename(0) = "TL.Woodblocks And Applicants.xml"
            filelocation(0) = "Databases/Items/"
            filenumber = 1
        ElseIf tmpa = "dir.items.typelists" Then  'Resources/Databases/Items - All Type Lists in Directory
            filename(0) = "TL.Alcoholic Beverages.xml"
            filelocation(0) = "Databases/Items/"
            filename(1) = "TL.Armor.xml"
            filelocation(1) = "Databases/Items/"
            filename(2) = "TL.Basic Forgin.xml"
            filelocation(2) = "Databases/Items/"
            filename(3) = "TL.Books.xml"
            filelocation(3) = "Databases/Items/"
            filename(4) = "TL.Bridles.xml"
            filelocation(4) = "Databases/Items/"
            filename(5) = "TL.Chemicals.xml"
            filelocation(5) = "Databases/Items/"
            filename(6) = "TL.Containers.xml"
            filelocation(6) = "Databases/Items/"
            filename(7) = "TL.Cooking Supplies.xml"
            filelocation(7) = "Databases/Items/"
            filename(8) = "TL.Fibers.xml"
            filelocation(8) = "Databases/Items/"
            filename(9) = "TL.Food.xml"
            filelocation(9) = "Databases/Items/"
            filename(10) = "TL.Furniture.xml"
            filelocation(10) = "Databases/Items/"
            filename(11) = "TL.Gambling.xml"
            filelocation(11) = "Databases/Items/"
            filename(12) = "TL.Harvestable Food.xml"
            filelocation(12) = "Databases/Items/"
            filename(13) = "TL.Herbs And Reagents.xml"
            filelocation(13) = "Databases/Items/"
            filename(14) = "TL.Hunting Supplies.xml"
            filelocation(14) = "Databases/Items/"
            filename(15) = "TL.Index.xml"
            filelocation(15) = "Databases/Items/"
            filename(16) = "TL.Instruments.xml"
            filelocation(16) = "Databases/Items/"
            filename(17) = "TL.Kits.xml"
            filelocation(17) = "Databases/Items/"
            filename(18) = "TL.Leathercrafting.xml"
            filelocation(18) = "Databases/Items/"
            filename(19) = "TL.Lights.xml"
            filelocation(19) = "Databases/Items/"
            filename(20) = "TL.Living Charters.xml"
            filelocation(20) = "Databases/Items/"
            filename(21) = "TL.Magical Items.xml"
            filelocation(21) = "Databases/Items/"
            filename(22) = "TL.Maps.xml"
            filelocation(22) = "Databases/Items/"
            filename(23) = "TL.Medical Supplies.xml"
            filelocation(23) = "Databases/Items/"
            filename(24) = "TL.Molds, Patterns, And Designs.xml"
            filelocation(24) = "Databases/Items/"
            filename(25) = "TL.Ores & Raw Gems.xml"
            filelocation(25) = "Databases/Items/"
            filename(26) = "TL.Outfits.xml"
            filelocation(26) = "Databases/Items/"
            filename(27) = "TL.Packs.xml"
            filelocation(27) = "Databases/Items/"
            filename(28) = "TL.Pets.xml"
            filelocation(28) = "Databases/Items/"
            filename(29) = "TL.Pipes.xml"
            filelocation(29) = "Databases/Items/"
            filename(30) = "TL.Potions And Magical Applicants.xml"
            filelocation(30) = "Databases/Items/"
            filename(31) = "TL.Rock Climbing.xml"
            filelocation(31) = "Databases/Items/"
            filename(32) = "TL.Scabbard.xml"
            filelocation(32) = "Databases/Items/"
            filename(33) = "TL.Soaps.xml"
            filelocation(33) = "Databases/Items/"
            filename(34) = "TL.Tailoring.xml"
            filelocation(34) = "Databases/Items/"
            filename(35) = "TL.Tents.xml"
            filelocation(35) = "Databases/Items/"
            filename(36) = "TL.Thievary Tools.xml"
            filelocation(36) = "Databases/Items/"
            filename(37) = "TL.Tools.xml"
            filelocation(37) = "Databases/Items/"
            filename(38) = "TL.Torture.xml"
            filelocation(38) = "Databases/Items/"
            filename(39) = "TL.Transportation.xml"
            filelocation(39) = "Databases/Items/"
            filename(40) = "TL.Treasure.xml"
            filelocation(40) = "Databases/Items/"
            filename(41) = "TL.Trinkets.xml"
            filelocation(41) = "Databases/Items/"
            filename(42) = "TL.Weapons.xml"
            filelocation(42) = "Databases/Items/"
            filename(43) = "TL.Woodblocks And Applicants.xml"
            filelocation(43) = "Databases/Items/"
            filenumber = 44
        ElseIf tmpa = "dir.items" Then 'Resources/Databases/Items - Everything in Directory
            filename(0) = "TL.Alcoholic Beverages.xml"
            filelocation(0) = "Databases/Items/"
            filename(1) = "TL.Armor.xml"
            filelocation(1) = "Databases/Items/"
            filename(2) = "TL.Basic Forgin.xml"
            filelocation(2) = "Databases/Items/"
            filename(3) = "TL.Books.xml"
            filelocation(3) = "Databases/Items/"
            filename(4) = "TL.Bridles.xml"
            filelocation(4) = "Databases/Items/"
            filename(5) = "TL.Chemicals.xml"
            filelocation(5) = "Databases/Items/"
            filename(6) = "TL.Containers.xml"
            filelocation(6) = "Databases/Items/"
            filename(7) = "TL.Cooking Supplies.xml"
            filelocation(7) = "Databases/Items/"
            filename(8) = "TL.Fibers.xml"
            filelocation(8) = "Databases/Items/"
            filename(9) = "TL.Food.xml"
            filelocation(9) = "Databases/Items/"
            filename(10) = "TL.Furniture.xml"
            filelocation(10) = "Databases/Items/"
            filename(11) = "TL.Gambling.xml"
            filelocation(11) = "Databases/Items/"
            filename(12) = "TL.Harvestable Food.xml"
            filelocation(12) = "Databases/Items/"
            filename(13) = "TL.Herbs And Reagents.xml"
            filelocation(13) = "Databases/Items/"
            filename(14) = "TL.Hunting Supplies.xml"
            filelocation(14) = "Databases/Items/"
            filename(15) = "TL.Index.xml"
            filelocation(15) = "Databases/Items/"
            filename(16) = "TL.Instruments.xml"
            filelocation(16) = "Databases/Items/"
            filename(17) = "TL.Kits.xml"
            filelocation(17) = "Databases/Items/"
            filename(18) = "TL.Leathercrafting.xml"
            filelocation(18) = "Databases/Items/"
            filename(19) = "TL.Lights.xml"
            filelocation(19) = "Databases/Items/"
            filename(20) = "TL.Living Charters.xml"
            filelocation(20) = "Databases/Items/"
            filename(21) = "TL.Magical Items.xml"
            filelocation(21) = "Databases/Items/"
            filename(22) = "TL.Maps.xml"
            filelocation(22) = "Databases/Items/"
            filename(23) = "TL.Medical Supplies.xml"
            filelocation(23) = "Databases/Items/"
            filename(24) = "TL.Molds, Patterns, And Designs.xml"
            filelocation(24) = "Databases/Items/"
            filename(25) = "TL.Ores & Raw Gems.xml"
            filelocation(25) = "Databases/Items/"
            filename(26) = "TL.Outfits.xml"
            filelocation(26) = "Databases/Items/"
            filename(27) = "TL.Packs.xml"
            filelocation(27) = "Databases/Items/"
            filename(28) = "TL.Pets.xml"
            filelocation(28) = "Databases/Items/"
            filename(29) = "TL.Pipes.xml"
            filelocation(29) = "Databases/Items/"
            filename(30) = "TL.Potions And Magical Applicants.xml"
            filelocation(30) = "Databases/Items/"
            filename(31) = "TL.Rock Climbing.xml"
            filelocation(31) = "Databases/Items/"
            filename(32) = "TL.Scabbard.xml"
            filelocation(32) = "Databases/Items/"
            filename(33) = "TL.Soaps.xml"
            filelocation(33) = "Databases/Items/"
            filename(34) = "TL.Tailoring.xml"
            filelocation(34) = "Databases/Items/"
            filename(35) = "TL.Tents.xml"
            filelocation(35) = "Databases/Items/"
            filename(36) = "TL.Thievary Tools.xml"
            filelocation(36) = "Databases/Items/"
            filename(37) = "TL.Tools.xml"
            filelocation(37) = "Databases/Items/"
            filename(38) = "TL.Torture.xml"
            filelocation(38) = "Databases/Items/"
            filename(39) = "TL.Transportation.xml"
            filelocation(39) = "Databases/Items/"
            filename(40) = "TL.Treasure.xml"
            filelocation(40) = "Databases/Items/"
            filename(41) = "TL.Trinkets.xml"
            filelocation(41) = "Databases/Items/"
            filename(42) = "TL.Weapons.xml"
            filelocation(42) = "Databases/Items/"
            filename(43) = "TL.Woodblocks And Applicants.xml"
            filelocation(43) = "Databases/Items/"
            filename(44) = "Items.xml"
            filelocation(44) = "Databases/Items/"
            filename(45) = "ML.Materials.xml"
            filelocation(45) = "Databases/Items/"
            filenumber = 46
        ElseIf tmpa = "mobs" Then 'Resources/Databases/Mobiles
            filename(0) = "Mobs.xml"
            filelocation(0) = "Databases/Mobiles/"
            filenumber = 1
        ElseIf tmpa = "scripts" Then  'Resources/Databases/Mobiles
            filename(0) = "Scripts.TG"
            filelocation(0) = "Databases/Mobiles/"
            filenumber = 1
        ElseIf tmpa = "tl.creatures" Then  'Resources/Databases/Mobiles
            filename(0) = "TL.Creatures.xml"
            filelocation(0) = "Databases/Mobiles/"
            filenumber = 1
        ElseIf tmpa = "dir.mobiles" Then  'Resources/Databases/Mobiles -  Everything in Directory
            filename(0) = "Mobs.xml"
            filelocation(0) = "Databases/Mobiles/"
            filename(1) = "Scripts.TG"
            filelocation(1) = "Databases/Mobiles/"
            filename(2) = "TL.Creatures.xml"
            filelocation(2) = "Databases/Mobiles/"
            filenumber = 3
            'ElseIf tmpa = "dir.music" Then 'Resources/Databases/Music - Everything in Directory
            'ElseIf tmpa = "dir.quests" Then 'there are no quests set in stone yet, uncomment when they're available
            'ElseIf tmpa = "dir.maps" Then 'Resources/Databases/World - Everything in Directory
        Else
            MainProgram.SND("/R'" + tmpa + "' is not an accurate database type to download.")
            MainProgram.SND("/mThe following are examples of database type names, for the entire list type 'help !server_get'")
            MainProgram.SND("/W'/gdir.abilities/W' : Resources/Databases/Abilities - All Abilities")
            MainProgram.SND("/W'/gelementalist/W' : Resources/Databases/Classes")
            MainProgram.SND("/W'/ggravedigger/W' : Resources/Databases/Classes")
            'SND("/W'/gheadhunter/W' : Resources/Databases/Classes")
            'SND("/W'/ghermit/W' : Resources/Databases/Classes")
            'SND("/W'/gmageling/W' : Resources/Databases/Classes")
            'SND("/W'/gminstrel/W' : Resources/Databases/Classes")
            'SND("/W'/gmonk/W' : Resources/Databases/Classes")
            'SND("/W'/gpage/W' : Resources/Databases/Classes")
            'SND("/W'/gpickpocket/W' : Resources/Databases/Classes")
            'SND("/W'/gplainsman/W' : Resources/Databases/Classes")
            'SND("/W'/gpriest/W' : Resources/Databases/Classes")
            'SND("/W'/grunescribe/W' : Resources/Databases/Classes")
            'SND("/W'/gscout/W' : Resources/Databases/Classes")
            'SND("/W'/gwoodsman/W' : Resources/Databases/Classes")
            'SND("/W'/gdir.classes/W' : Resources/Databases/Classes - All Classes")
            'SND("/W'/gdir.emotes/W' : Resources/Databases/Emotes - All Emotes")
            'SND("/W'/gclayhelp/W' : Resources/Databases/Help")
            'SND("/W'/gclayversion/W' : Resources/Databases/Help")
            'SND("/W'/gcommands/W' : Resources/Databases/Help")
            'SND("/W'/gplosversion/W' : Resources/Databases/Help")
            'SND("/W'/gdir.help/W' : Resources/Databases/Help - All Files in Help Dir")
            'SND("/W'/gitems/W' : Resources/Databases/Items")
            'SND("/W'/gml.materials/W' : Resources/Databases/Items")
            'SND("/W'/gtl.alcoholic beverages/W' : Resources/Databases/Items")
            'SND("/W'/gtl.armor/W' : Resources/Databases/Items")
            'SND("/W'/gtl.basic forging/W' : Resources/Databases/Items")
            'SND("/W'/gtl.books/W' : Resources/Databases/Items")
            'SND("/W'/gtl.bridles/W' : Resources/Databases/Items")
            'SND("/W'/gtl.chemicals/W' : Resources/Databases/Items")
            'SND("/W'/gtl.containers/W' : Resources/Databases/Items")
            'SND("/W'/gtl.cooking supplies/W' : Resources/Databases/Items")
            'SND("/W'/gtl.fibers/W' : Resources/Databases/Items")
            'SND("/W'/gtl.food/W' : Resources/Databases/Items")
            'SND("/W'/gtl.furniture/W' : Resources/Databases/Items")
            'SND("/W'/gtl.gambling/W' : Resources/Databases/Items")
            'SND("/W'/gtl.harvestable food/W' : Resources/Databases/Items")
            'SND("/W'/gtl.herbs and reagents/W' : Resources/Databases/Items")
            'SND("/W'/gtl.hunting supplies/W' : Resources/Databases/Items")
            'SND("/W'/gtl.index/W' : Resources/Databases/Items")
            'SND("/W'/gtl.instruments/W' : Resources/Databases/Items")
            'SND("/W'/gtl.kits/W' : Resources/Databases/Items")
            'SND("/W'/gtl.leathercrafting/W' : Resources/Databases/Items")
            'SND("/W'/gtl.lights/W' : Resources/Databases/Items")
            'SND("/W'/gtl.living charters/W' : Resources/Databases/Items")
            'SND("/W'/gtl.magical items/W' : Resources/Databases/Items")
            'SND("/W'/gtl.maps/W' : Resources/Databases/Items")
            'SND("/W'/gtl.medical supplies/W' : Resources/Databases/Items")
            'SND("/W'/gtl.molds, patterns, and designs/W' : Resources/Databases/Items")
            'SND("/W'/gtl.ores & raw gems/W' : Resources/Databases/Items")
            'SND("/W'/gtl.outfits/W' : Resources/Databases/Items")
            'SND("/W'/gtl.packs/W' : Resources/Databases/Items")
            'SND("/W'/gtl.pets/W' : Resources/Databases/Items")
            'SND("/W'/gtl.pipes/W' : Resources/Databases/Items")
            'SND("/W'/gtl.potions and magical applicants/W' : Resources/Databases/Items")
            'SND("/W'/gtl.rock climbing/W' : Resources/Databases/Items")
            'SND("/W'/gtl.scabbard/W' : Resources/Databases/Items")
            'SND("/W'/gtl.soaps/W' : Resources/Databases/Items")
            'SND("/W'/gtl.tailoring/W' : Resources/Databases/Items")
            'SND("/W'/gtl.tents/W' : Resources/Databases/Items")
            'SND("/W'/gtl.thievary tools/W' : Resources/Databases/Items")
            'SND("/W'/gtl.tools/W' : Resources/Databases/Items")
            'SND("/W'/gtl.torture/W' : Resources/Databases/Items")
            'SND("/W'/gtl.transportation/W' : Resources/Databases/Items")
            'SND("/W'/gtl.treasure/W' : Resources/Databases/Items")
            'SND("/W'/gtl.trinkets/W' : Resources/Databases/Items")
            'SND("/W'/gtl.weapons/W' : Resources/Databases/Items")
            'SND("/W'/gtl.woodblocks and applicants/W' : Resources/Databases/Items")
            'SND("/W'/gdir.items.typelists/W' : Resources/Databases/Items - All Type Lists in Directory")
            'SND("/W'/gdir.items/W' : Resources/Databases/Items - Everything in Directory")
            'SND("/W'/gmobs/W' : Resources/Databases/Mobiles")
            'SND("/W'/gscripts/W' : Resources/Databases/Mobiles")
            'SND("/W'/gtl.creatures/W' : Resources/Databases/Mobiles")
            'SND("/W'/gdir.mobiles/W' : Resources/Databases/Mobiles -  Everything in Directory")
            'SND("/W'/gdir.music/W' : Resources/Databases/Music - Everything in Directory")
            'SND("/W'/gdir.quests/W' : Resources/Databases/Quests - Everything in Directory")
            'SND("/W'/gdir.maps/W' : Resources/Databases/World - Everything in Directory")
            Exit Sub
        End If
        While CurNumber < filenumber
            'the webrequest replaces all spaces in file names with %20 as necessary
            Dim wr As HttpWebRequest = CType(WebRequest.Create("http://plosdb.googlecode.com/svn/trunk/" + filelocation(CurNumber) + Replace(filename(CurNumber), " ", "%20")), HttpWebRequest)
            Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)
            Dim str As Stream = ws.GetResponseStream()
            Dim inBuf(10000000) As Byte
            Dim bytesToRead As Integer = CInt(inBuf.Length)
            Dim bytesRead As Integer = 0
            Try
                While bytesToRead > 0
                    Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)
                    If n = 0 Then
                        Exit While
                    End If
                    bytesRead += n
                    bytesToRead -= n
                End While
                Dim fstr As New FileStream(MainProgram.ResourcesDir + filelocation(CurNumber) + filename(CurNumber), FileMode.OpenOrCreate, FileAccess.Write)
                fstr.Write(inBuf, 0, bytesRead)
                str.Close()
                fstr.Close()
                MainProgram.SND("/GDownloaded latest /Z" + filename(CurNumber) + "/g /Y@/y" + filelocation(CurNumber) + "/G.")
            Catch errorvariable As Exception 'just incase file is corrupt or missing
                MainProgram.SND("/RERROR: " + errorvariable.ToString())
            End Try
            CurNumber += 1
        End While
    End Sub
    Private Sub CMD_server_rem(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If tmpa = "last" Then
            CharacterUpdates.GetUpdatesList("RemoveLast")
            MainProgram.SND("/yYou /Ydeleted /ythe last character update from the list.")
            MainProgram.SND("/y    Note : The character save files have not been touched.")
        Else
            MainProgram.SND("/RImproper use. /yType /w'/g!server_rem/w'/y for help.")
        End If
    End Sub
    Private Sub CMD_server_cur(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If tmpa = "5" Then
            CharacterUpdates.GetUpdatesList("ShowLast5")
        ElseIf tmpa = "10" Then
            CharacterUpdates.GetUpdatesList("ShowLast10")
        ElseIf tmpa = "15" Then
            CharacterUpdates.GetUpdatesList("ShowLast15")
        Else
            MainProgram.SND("/RImproper use. /yType /w'/g!server_cur/w'/y for help.")
        End If
    End Sub
    Private Sub CMD_server_upd(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If tmpa = "force" Then
            CharacterUpdates.GetUpdatesList() 'forces the character to be added to the update list without saving locally or mainprogram.remotely
        Else
            MainProgram.SND("/RImproper use. /yType /w'/g!server_upd/w'/y for help.")
        End If
    End Sub
    Private Sub CMD_server_pin(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        'grab the string the user input to ping the server
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        Try
            'declare the webservice
            Dim webservice As New TheOEStudio_PLOS_Server.ServerCommands
            'send command and display output returned
            MainProgram.SND(webservice.pingrequest(tmpa))
        Catch errorvariable As Exception 'just incase file is corrupt or missing
            MainProgram.SND("/RERROR: " + errorvariable.ToString())
        End Try
    End Sub
#End Region
#Region "Set MainProgram.Userdat"
    Private Sub CMD_set_userdat_vern(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Vern = tmpa
        MainProgram.SND("/YUSERdat_vern /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_dover(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Dover = tmpa
        MainProgram.SND("/YUSERdat_dover /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_sovern(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Sovern = tmpa
        MainProgram.SND("/YUSERdat_sovern /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_bankvern(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_BankVern = tmpa
        MainProgram.SND("/YUSERdat_bankvern /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_bankdover(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_BankDover = tmpa
        MainProgram.SND("/YUSERdat_bankdover /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_banksovern(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_BankSovern = tmpa
        MainProgram.SND("/YUSERdat_banksovern /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_hunger(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Hungry = Val(tmpa)
        MainProgram.SND("/YUSERdat_hunger /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_thirst(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Thirsty = Val(tmpa)
        MainProgram.SND("/YUSERdat_thirst /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_curhp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_CurHP = Val(tmpa)
        MainProgram.SND("/YUSERdat_curhp /z-> /g" + tmpa)
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_set_userdat_maxhp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_MaxHP = Val(tmpa)
        MainProgram.SND("/YUSERdat_maxhp /z-> /g" + tmpa)
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_set_userdat_curwp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_CurWP = Val(tmpa)
        MainProgram.SND("/YUSERdat_curwp /z-> /g" + tmpa)
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_set_userdat_maxwp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_MaxWP = Val(tmpa)
        MainProgram.SND("/YUSERdat_maxwp /z-> /g" + tmpa)
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_set_userdat_cursp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_CurSP = Val(tmpa)
        MainProgram.SND("/YUSERdat_cursp /z-> /g" + tmpa)
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_set_userdat_maxsp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_MaxSP = Val(tmpa)
        MainProgram.SND("/YUSERdat_maxsp /z-> /g" + tmpa)
        MainProgram.UpdateBars()
    End Sub
    Private Sub CMD_set_userdat_strmod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Strengthmod = Val(tmpa)
        MainProgram.SND("/YUSERdat_strmod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_strmax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_StrengthMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_strmax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_dexmod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Dexteritymod = Val(tmpa)
        MainProgram.SND("/YUSERdat_dexmod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_dexmax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_DexterityMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_dexmax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_conmod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Constitutionmod = Val(tmpa)
        MainProgram.SND("/YUSERdat_conmod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_conmax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_ConstitutionMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_conmax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_intmod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Intelligencemod = Val(tmpa)
        MainProgram.SND("/YUSERdat_intmod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_intmax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_IntelligenceMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_intmax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_wismod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Wisdommod = Val(tmpa)
        MainProgram.SND("/YUSERdat_wismod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_wismax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_WisdomMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_wismax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_chamod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Charismamod = Val(tmpa)
        MainProgram.SND("/YUSERdat_chamod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_chamax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_CharismaMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_chamax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_lucmod(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Luckmod = Val(tmpa)
        MainProgram.SND("/YUSERdat_lucmod /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_lucmax(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_LuckMax = Val(tmpa)
        MainProgram.SND("/YUSERdat_lucmax /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_sleep(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Sleeping = Val(tmpa)
        MainProgram.SND("/YUSERdat_sleep /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_level(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Level = Val(tmpa)
        MainProgram.SND("/YUSERdat_Level /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_gender(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        If tmpa = "m" Or tmpa = "male" Then
            MainProgram.SND("/YUSERdat_Gender /z-> /gMale")
            MainProgram.User_Gender = "Male"
        ElseIf tmpa = "n" Or tmpa = "neutral" Then
            MainProgram.SND("/YUSERdat_Gender /z-> /gNeutral")
            MainProgram.User_Gender = "Neutral"
        ElseIf tmpa = "f" Or tmpa = "female" Then
            MainProgram.SND("/YUSERdat_Gender /z-> /gFemale")
            MainProgram.User_Gender = "Female"
        Else
            MainProgram.SND("/rCould not change to gender: " + tmpa)
            MainProgram.SND("/rUse m,n,f or male,neutral,female to change gender.")
        End If
    End Sub
    Private Sub CMD_set_userdat_additem(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_additem(tmpa)
    End Sub
    Private Sub CMD_set_userdat_password(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Password = tmpa
        MainProgram.SND("/YUSERdat_Password /z-> /g" + tmpa)
    End Sub
    Private Sub CMD_set_userdat_curxp(ByVal txt As String, ByVal cmdlen As Short)
        Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.User_Experience = Val(tmpa)
        MainProgram.SND("/YUSERdat_curXP /z-> /g" + tmpa)
        MainProgram.UpdatePlayerExperience()
    End Sub
    Private Sub CMD_set_userdat_unarmed_dienum(ByVal txt As String, ByVal cmdlen As Short)
        MainProgram.User_Unarmed_dienum = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.SND("/YUSERdat_Unarmed_dienum /z-> /g" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
    End Sub
    Private Sub CMD_set_userdat_unarmed_dietype(ByVal txt As String, ByVal cmdlen As Short)
        MainProgram.User_Unarmed_dietype = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.SND("/YUSERdat_Unarmed_dietype /z-> /g" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
    End Sub
    Private Sub CMD_set_userdat_unarmed_speed(ByVal txt As String, ByVal cmdlen As Short)
        MainProgram.User_Unarmed_speed = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.SND("/YUSERdat_Unarmed_speed /z-> /g" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
    End Sub
    Private Sub CMD_set_userdat_practices(ByVal txt As String, ByVal cmdlen As Short)
        MainProgram.User_PracticePoints = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.SND("/YUSERdat_Practices /z-> /g" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
    End Sub
    Private Sub CMD_set_userdat_trains(ByVal txt As String, ByVal cmdlen As Short)
        MainProgram.User_TrainingPoints = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
        MainProgram.SND("/YUSERdat_Trains /z-> /g" + LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
    End Sub
    Private Sub CMD_HideCommunicationReturns(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim tmpA As String = LCase(LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt)))))
        If tmpA = Mid("yes", 1, Len(tmpA)) Then
            MainProgram.HideCommunicationReturns = True
            MainProgram.SND("/yCommunication returns are now hidden.")
        ElseIf tmpA = Mid("no", 1, Len(tmpA)) Then
            MainProgram.HideCommunicationReturns = False
            MainProgram.SND("/yCommunication returns are now visible.")
        Else
            MainProgram.SND("/RThat isn't an option.")
            MainProgram.SND("/yFor more information try 'help hidecommunicationreturns'")
        End If
    End Sub
#End Region
#End Region
#Region "Closed MainProgram.State"
    Private Sub ClosedStateInput(ByVal txt As String, ByVal nputlen As Short)
        Dim cmdvar As String = "" : Dim cmdlen As Short = 0
        For cmdlen = 1 To Len(txt) Step 1
            If Mid(txt, cmdlen, 1) = " " Then
                cmdvar = Mid(txt, 1, cmdlen - 1)
                cmdlen = Len(cmdvar)
                Exit For
            End If
        Next
        Dim tmp0 As Short
        For tmp0 = 0 To 4 Step 1
            If txt = Mid(LCase(MainProgram.StateOption(tmp0)), 1, nputlen) Then
                If InStr(MainProgram.ScriptData_Option(tmp0), "[EXIT]") Then
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") Then
                        Dim tempvarX As Short
                        Dim tempvarY As Short
                        Dim BackupMobile As String
                        Dim QuestTarget As String = ""
                        Dim QuestTaker As String = ""
                        For tempvarX = InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") To Len(MainProgram.ScriptData_Option(tmp0)) Step 1
                            If Mid(MainProgram.ScriptData_Option(tmp0), tempvarX, 1) = "," Then
                                QuestTarget = Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") - 7)
                            ElseIf Mid(MainProgram.ScriptData_Option(tmp0), tempvarX, 1) = "]" Then
                                QuestTaker = Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") + 7 + Len(QuestTarget) + 1, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") - 7 - Len(QuestTarget) - 1)
                                Exit For
                            End If
                        Next
                        For tempvarY = 0 To 9 Step 1
                            If MainProgram.User_questtarget(tempvarY) = QuestTarget Then
                                MainProgram.SND("/RYou are already on that quest.")
                                Exit For
                            Else
                                Dim roomforquest As Short
                                For roomforquest = 0 To 9 Step 1
                                    If MainProgram.User_questtarget(roomforquest) = "" Then
                                        BackupMobile = MainProgram.MobData_VIRID
                                        LoadMob(QuestTarget, False)
                                        MainProgram.User_quest(roomforquest) = "/zKill/z " + MainProgram.MobData_SHORT + "/z."
                                        MainProgram.User_questtarget(roomforquest) = MainProgram.MobData_VIRID
                                        MainProgram.SND("/YYou receive a quest to kill " + MainProgram.MobData_SHORT + "/g.")
                                        LoadMob(BackupMobile, False)
                                        MainProgram.User_questgiver(roomforquest) = BackupMobile
                                        MainProgram.User_questtaker(roomforquest) = QuestTaker
                                        Exit For
                                    End If
                                Next
                                Exit For
                            End If
                        Next
                        MainProgram.scriptData_Option(tmp0) = Replace(MainProgram.ScriptData_Option(tmp0), "[BEG Q_" + Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") - 7) + "]", "")
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") Then
                        Dim tempvarX As Short
                        Dim tempvarY As Short
                        Dim Backupmobile As String
                        Dim Temp As Integer
                        For tempvarX = InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") To Len(MainProgram.ScriptData_Option(tmp0)) Step 1
                            If Mid(MainProgram.ScriptData_Option(tmp0), tempvarX, 1) = "]" Then
                                Exit For
                            End If
                        Next
                        For tempvarY = 0 To 9 Step 1
                            If MainProgram.User_questtarget(tempvarY) = Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") - 7) Then
                                Backupmobile = MainProgram.MobData_VIRID
                                LoadMob(Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") - 7))
                                If Val(MainProgram.MobData_LEVEL) - 6 > MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(60, 101)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) - 3 > MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(30, 61)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) > MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(15, 31)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) = MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(10, 16)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) < MainProgram.User_Level - 6 Then
                                    MainProgram.SND("/cYou did not receive any experience.")
                                ElseIf Val(MainProgram.MobData_LEVEL) < MainProgram.User_Level - 3 Then
                                    Temp = mainprogram.DamageCount.Next(1, 6)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) < MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(5, 11)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                End If
                                If MainProgram.User_Experience < 1000 Then
                                    MainProgram.MainFlash.SetVariable("xpf.xp", Str(MainProgram.User_Experience) + "/1000")
                                Else
                                    MainProgram.User_Experience -= 1000
                                    MainProgram.User_Level += 1
                                    MainProgram.SND("/YYou've achieved level " + LTrim(Str(MainProgram.User_Level)) + "!")
                                End If
                                MainProgram.MainFlash.TGotoFrame("xpbar", Math.Round(100 / 1000 * MainProgram.User_Experience, 0, MidpointRounding.AwayFromZero))
                                MainProgram.MainFlash.TGotoFrame("xpf", 1)
                                MainProgram.MainFlash.TPlay("xpf")
                                MainProgram.User_questtarget(tempvarY) = ""
                                MainProgram.User_questgiver(tempvarY) = "" : MainProgram.User_questtaker(tempvarY) = ""
                                MainProgram.User_quest(tempvarY) = ""
                                MainProgram.User_questcomplete(tempvarY) = False
                                LoadMob(Backupmobile)
                                Exit For
                            End If
                        Next
                        MainProgram.scriptData_Option(tmp0) = Replace(MainProgram.ScriptData_Option(tmp0), "[END Q_" + Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") - 7) + "]", "")
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "<$>") Or InStr(MainProgram.ScriptData_Option(tmp0), "<!>") Or InStr(MainProgram.ScriptData_Option(tmp0), "<P>") Then
                        Dim tmp6 As Integer, tmpE As String = Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.ScriptData_Option(tmp0), "[DEL O1]", ""), "[DEL O2]", ""), "[DEL O3]", ""), "[DEL O4]", ""), "[DEL O5]", "") + "<X>", "[EXIT]", ""), IsEmote As Boolean = False, TheString As String = ""
                        Dim CountDown As Short = 0, MoneyToggled As Boolean = False, Amount As String = "", MoneyType As String = "", Itemtoggled As Boolean = False
                        For tmp6 = 1 To Len(tmpE) Step 1
                            If Mid(tmpE, tmp6, 3) = "<!>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 3
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = True
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<P>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 3
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = False
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<$>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 1002
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = False
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<#>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 2002
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = False
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<X>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                Exit For
                            End If
                            If CountDown > 1005 And CountDown < 2000 Then
                                Itemtoggled = True
                                Amount += Mid(tmpE, tmp6, 1)
                            ElseIf CountDown > 100 And CountDown < 1000 Then
                                If Mid(tmpE, tmp6, 1) = "S" Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                    MoneyType = "Sovern"
                                    MoneyToggled = True
                                ElseIf Mid(tmpE, tmp6, 1) = "D" Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                    MoneyType = "Dover"
                                    MoneyToggled = True
                                ElseIf Mid(tmpE, tmp6, 1) = "V" Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                    MoneyType = "Vern"
                                    MoneyToggled = True
                                Else
                                    Amount += Mid(tmpE, tmp6, 1)
                                End If
                            ElseIf CountDown > 0 Then
                                CountDown -= 1
                            Else
                                TheString += Mid(tmpE, tmp6, 1)
                            End If
                        Next
                    Else
                        MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.ScriptData_Option(tmp0), "[DEL O1]", ""), "[DEL O2]", ""), "[DEL O3]", ""), "[DEL O4]", ""), "[DEL O5]", ""), "[EXIT]", "") + Chr(34))
                    End If
                    MainProgram.State = "Open"
                    Exit For
                Else 'user selected an option that isn't supposed to close MainProgram.dialogue completely
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") Then
                        Dim tempvarX As Short
                        Dim tempvarY As Short
                        Dim BackupMobile As String
                        Dim QuestTarget As String = ""
                        Dim QuestTaker As String = ""
                        For tempvarX = InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") To Len(MainProgram.ScriptData_Option(tmp0)) Step 1
                            If Mid(MainProgram.ScriptData_Option(tmp0), tempvarX, 1) = "," Then
                                QuestTarget = Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") - 7)
                            ElseIf Mid(MainProgram.ScriptData_Option(tmp0), tempvarX, 1) = "]" Then
                                QuestTaker = Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") + 7 + Len(QuestTarget) + 1, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") - 7 - Len(QuestTarget) - 1)
                                Exit For
                            End If
                        Next
                        For tempvarY = 0 To 9 Step 1
                            If MainProgram.User_questtarget(tempvarY) = QuestTarget Then
                                MainProgram.SND("/RYou are already on that quest.")
                                Exit For
                            Else
                                Dim roomforquest As Short
                                For roomforquest = 0 To 9 Step 1
                                    If MainProgram.User_questtarget(roomforquest) = "" Then
                                        BackupMobile = MainProgram.MobData_VIRID
                                        LoadMob(QuestTarget)
                                        MainProgram.User_quest(roomforquest) = "/zKill/z " + MainProgram.MobData_SHORT + "/z."
                                        MainProgram.User_questtarget(roomforquest) = MainProgram.MobData_VIRID
                                        MainProgram.SND("/YYou receive a quest to kill " + MainProgram.MobData_SHORT + "/g.")
                                        LoadMob(BackupMobile)
                                        MainProgram.User_questgiver(roomforquest) = BackupMobile
                                        MainProgram.User_questtaker(roomforquest) = QuestTaker
                                        Exit For
                                    End If
                                Next
                                Exit For
                            End If
                        Next
                        MainProgram.scriptData_Option(tmp0) = Replace(MainProgram.ScriptData_Option(tmp0), "[BEG Q_" + Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[BEG Q_") - 7) + "]", "")
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") Then
                        Dim tempvarX As Short
                        Dim tempvarY As Short
                        Dim Backupmobile As String
                        Dim Temp As Integer
                        For tempvarX = InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") To Len(MainProgram.ScriptData_Option(tmp0)) Step 1
                            If Mid(MainProgram.ScriptData_Option(tmp0), tempvarX, 1) = "]" Then
                                Exit For
                            End If
                        Next
                        For tempvarY = 0 To 9 Step 1
                            If MainProgram.User_questtarget(tempvarY) = Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") - 7) Then
                                Backupmobile = MainProgram.MobData_VIRID
                                LoadMob(Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") - 7))
                                If Val(MainProgram.MobData_LEVEL) - 6 > MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(60, 101)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) - 3 > MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(30, 61)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) > MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(15, 31)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) = MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(10, 16)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) < MainProgram.User_Level - 6 Then
                                    MainProgram.SND("/cYou did not receive any experience.")
                                ElseIf Val(MainProgram.MobData_LEVEL) < MainProgram.User_Level - 3 Then
                                    Temp = mainprogram.DamageCount.Next(1, 6)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                ElseIf Val(MainProgram.MobData_LEVEL) < MainProgram.User_Level Then
                                    Temp = mainprogram.DamageCount.Next(5, 11)
                                    MainProgram.User_Experience += Temp * 5
                                    MainProgram.SND("/cYou gained /C" + LTrim(Str(Temp)) + "/c experience!")
                                End If
                                If MainProgram.User_Experience < 1000 Then
                                    MainProgram.MainFlash.SetVariable("xpf.xp", Str(MainProgram.User_Experience) + "/1000")
                                Else
                                    MainProgram.User_Experience -= 1000
                                    MainProgram.User_Level += 1
                                    MainProgram.SND("/YYou've achieved level " + LTrim(Str(MainProgram.User_Level)) + "!")
                                End If
                                MainProgram.MainFlash.TGotoFrame("xpbar", Math.Round(100 / 1000 * MainProgram.User_Experience, 0, MidpointRounding.AwayFromZero))
                                MainProgram.MainFlash.TGotoFrame("xpf", 1)
                                MainProgram.MainFlash.TPlay("xpf")
                                MainProgram.User_questtarget(tempvarY) = ""
                                MainProgram.User_questgiver(tempvarY) = "" : MainProgram.User_questtaker(tempvarY) = ""
                                MainProgram.User_quest(tempvarY) = ""
                                MainProgram.User_questcomplete(tempvarY) = False
                                LoadMob(Backupmobile)
                                Exit For
                            End If
                        Next
                        MainProgram.scriptData_Option(tmp0) = Replace(MainProgram.ScriptData_Option(tmp0), "[END Q_" + Mid(MainProgram.ScriptData_Option(tmp0), InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") + 7, tempvarX - InStr(MainProgram.ScriptData_Option(tmp0), "[END Q_") - 7) + "]", "")
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "<$>") Or InStr(MainProgram.ScriptData_Option(tmp0), "<!>") Or InStr(MainProgram.ScriptData_Option(tmp0), "<P>") Then
                        Dim tmp6 As Integer, tmpE As String = Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.ScriptData_Option(tmp0), "[DEL O1]", ""), "[DEL O2]", ""), "[DEL O3]", ""), "[DEL O4]", ""), "[DEL O5]", "") + "<X>", "[EXIT]", ""), IsEmote As Boolean = False, TheString As String = ""
                        Dim CountDown As Short = 0, MoneyToggled As Boolean = False, Amount As String = "", MoneyType As String = "", Itemtoggled As Boolean = False
                        For tmp6 = 1 To Len(tmpE) Step 1
                            If Mid(tmpE, tmp6, 3) = "<!>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 3
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = True
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<P>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 3
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = False
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<$>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 1002
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = False
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<#>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                CountDown = 2002
                                MoneyToggled = False
                                Itemtoggled = False
                                IsEmote = False
                                TheString = "" : Amount = ""
                            ElseIf Mid(tmpE, tmp6, 3) = "<X>" Then
                                If MoneyToggled = False And Itemtoggled = False Then
                                    If IsEmote = True Then
                                        MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                    Else
                                        If Len(LTrim(TheString)) > 0 Then MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                    End If
                                ElseIf MoneyToggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                ElseIf Itemtoggled = True Then
                                    If LTrim(RTrim(Amount)) <> "" Then
                                        LoadItem.LoadItem(LTrim(RTrim(Amount)))
                                        MainProgram.User_additem(Amount)
                                    End If
                                End If
                                Exit For
                            End If
                            If CountDown > 1005 And CountDown < 2000 Then
                                Itemtoggled = True
                                Amount += Mid(tmpE, tmp6, 1)
                            ElseIf CountDown > 100 And CountDown < 1000 Then
                                If Mid(tmpE, tmp6, 1) = "S" Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                    MoneyType = "Sovern"
                                    MoneyToggled = True
                                ElseIf Mid(tmpE, tmp6, 1) = "D" Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                    MoneyType = "Dover"
                                    MoneyToggled = True
                                ElseIf Mid(tmpE, tmp6, 1) = "V" Then
                                    If LTrim(RTrim(Amount)) <> "" And LTrim(RTrim(MoneyType)) <> "" Then
                                        MainProgram.SND("/gYou received " + LTrim(RTrim(Amount)) + " " + MoneyType + ".")
                                        If MoneyType = "Sovern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Sovern) + Val(Amount)
                                        ElseIf MoneyType = "Dover" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Dover) + Val(Amount)
                                        ElseIf MoneyType = "Vern" Then
                                            MainProgram.User_Vern = Val(MainProgram.User_Vern) + Val(Amount)
                                        End If
                                    End If
                                    MoneyType = "Vern"
                                    MoneyToggled = True
                                Else
                                    Amount += Mid(tmpE, tmp6, 1)
                                End If
                            ElseIf CountDown > 0 Then
                                CountDown -= 1
                            Else
                                TheString += Mid(tmpE, tmp6, 1)
                            End If
                        Next
                    Else
                        MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + Replace(Replace(Replace(Replace(Replace(Replace(MainProgram.ScriptData_Option(tmp0), "[DEL O1]", ""), "[DEL O2]", ""), "[DEL O3]", ""), "[DEL O4]", ""), "[DEL O5]", ""), "[EXIT]", "") + Chr(34))
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[DEL O1]") Then
                        MainProgram.StateOption(0) = ""
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[DEL O2]") Then
                        MainProgram.StateOption(1) = ""
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[DEL O3]") Then
                        MainProgram.StateOption(2) = ""
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[DEL O4]") Then
                        MainProgram.StateOption(3) = ""
                    End If
                    If InStr(MainProgram.ScriptData_Option(tmp0), "[DEL O5]") Then
                        MainProgram.StateOption(4) = ""
                    End If
                    If InStr(MainProgram.ScriptData_REFRESH, "<!>") Or InStr(MainProgram.ScriptData_REFRESH, "<P>") Then
                        Dim tmp6 As Integer, tmpE As String = Replace(MainProgram.ScriptData_REFRESH + "<X>", "[EXIT]", ""), IsEmote As Boolean = False, TheString As String = ""
                        Dim CountDown As Short = 0
                        For tmp6 = 1 To Len(tmpE) Step 1
                            If Mid(tmpE, tmp6, 3) = "<!>" Then
                                CountDown = 3
                                IsEmote = True
                            ElseIf Mid(tmpE, tmp6, 3) = "<P>" Then
                                CountDown = 3
                                If IsEmote = True Then
                                    MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                Else
                                    MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + TheString + Chr(34))
                                End If
                                TheString = ""
                                IsEmote = False
                            ElseIf Mid(tmpE, tmp6, 3) = "<$>" Then
                                MainProgram.SND("/GLSJKDFSLJKDSLDJKLDSJKF")
                            ElseIf Mid(tmpE, tmp6, 3) = "<X>" Then
                                CountDown = 3
                                If IsEmote = True Then
                                    MainProgram.SND("/g" + MainProgram.MobData_MNAME + " " + LTrim(RTrim(TheString)))
                                Else
                                    MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + LTrim(RTrim(TheString)) + Chr(34))
                                End If
                                Exit For
                            End If
                            If CountDown > 0 Then
                                CountDown -= 1
                            Else
                                TheString += Mid(tmpE, tmp6, 1)
                            End If
                        Next
                    Else
                        MainProgram.SND("/W" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + Replace(MainProgram.ScriptData_REFRESH, "[EXIT]", "") + Chr(34))
                    End If
                    MainProgram.State = "Open"
                    CMD("talk !@n4th4ni3l@! " + MainProgram.MobData_MNAME)
                End If
                Exit For
            End If
        Next
    End Sub
#End Region
#Region "Combat MainProgram.State"
    Private Sub CombatStateInput(ByVal txt As String, ByVal nputlen As Short)
        Dim cmdvar As String = "" : Dim cmdlen As Short = 0
        For cmdlen = 1 To Len(txt) Step 1
            If Mid(txt, cmdlen, 1) = " " Then
                cmdvar = Mid(txt, 1, cmdlen - 1)
                cmdlen = Len(cmdvar)
                Exit For
            End If
        Next
        Dim Numvar As Short
        If MainProgram.UserLocation_NorthCNCT > 0 Then Numvar += 1
        If MainProgram.UserLocation_SouthCNCT > 0 Then Numvar += 1
        If MainProgram.UserLocation_EastCNCT > 0 Then Numvar += 1
        If MainProgram.UserLocation_WestCNCT > 0 Then Numvar += 1
        If MainProgram.UserLocation_UpCNCT > 0 Then Numvar += 1
        If MainProgram.UserLocation_DownCNCT > 0 Then Numvar += 1
        If txt = Mid("flee", 1, nputlen) Then
            If Numvar > 0 Then
                Select Case mainprogram.DamageCount.Next(1, Numvar)
                    Case 1
                        If MainProgram.UserLocation_NorthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the North.")
                        ElseIf MainProgram.UserLocation_SouthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the South.")
                        ElseIf MainProgram.UserLocation_EastCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the East.")
                        ElseIf MainProgram.UserLocation_WestCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the West.")
                        ElseIf MainProgram.UserLocation_UpCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                            MainProgram.SND("/gYou successfully flee upwards.")
                        ElseIf MainProgram.UserLocation_DownCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                            MainProgram.SND("/gYou successfully flee downwards.")
                        End If
                    Case 2
                        If MainProgram.UserLocation_SouthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the South.")
                        ElseIf MainProgram.UserLocation_EastCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the East.")
                        ElseIf MainProgram.UserLocation_WestCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the West.")
                        ElseIf MainProgram.UserLocation_UpCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                            MainProgram.SND("/gYou successfully flee upwards.")
                        ElseIf MainProgram.UserLocation_DownCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                            MainProgram.SND("/gYou successfully flee downwards.")
                        ElseIf MainProgram.UserLocation_NorthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the North.")
                        End If
                    Case 3
                        If MainProgram.UserLocation_EastCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the East.")
                        ElseIf MainProgram.UserLocation_WestCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the West.")
                        ElseIf MainProgram.UserLocation_UpCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                            MainProgram.SND("/gYou successfully flee upwards.")
                        ElseIf MainProgram.UserLocation_DownCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                            MainProgram.SND("/gYou successfully flee downwards.")
                        ElseIf MainProgram.UserLocation_NorthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the North.")
                        ElseIf MainProgram.UserLocation_SouthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the South.")
                        End If
                    Case 4
                        If MainProgram.UserLocation_WestCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the West.")
                        ElseIf MainProgram.UserLocation_UpCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                            MainProgram.SND("/gYou successfully flee upwards.")
                        ElseIf MainProgram.UserLocation_DownCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                            MainProgram.SND("/gYou successfully flee downwards.")
                        ElseIf MainProgram.UserLocation_NorthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the North.")
                        ElseIf MainProgram.UserLocation_SouthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the South.")
                        ElseIf MainProgram.UserLocation_EastCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the East.")
                        End If
                    Case 5
                        If MainProgram.UserLocation_UpCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                            MainProgram.SND("/gYou successfully flee upwards.")
                        ElseIf MainProgram.UserLocation_DownCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                            MainProgram.SND("/gYou successfully flee downwards.")
                        ElseIf MainProgram.UserLocation_NorthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the North.")
                        ElseIf MainProgram.UserLocation_SouthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the South.")
                        ElseIf MainProgram.UserLocation_EastCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the East.")
                        ElseIf MainProgram.UserLocation_WestCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the West.")
                        End If
                    Case 6
                        If MainProgram.UserLocation_DownCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_DownCNCT, 1)
                            MainProgram.SND("/gYou successfully flee downwards.")
                        ElseIf MainProgram.UserLocation_NorthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_NorthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the North.")
                        ElseIf MainProgram.UserLocation_SouthCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_SouthCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the South.")
                        ElseIf MainProgram.UserLocation_EastCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_EastCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the East.")
                        ElseIf MainProgram.UserLocation_WestCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_WestCNCT, 1)
                            MainProgram.SND("/gYou successfully flee to the West.")
                        ElseIf MainProgram.UserLocation_UpCNCT > 0 Then
                            LoadSector.LoadSector(MainProgram.UserLocation_UpCNCT, 1)
                            MainProgram.SND("/gYou successfully flee upwards.")
                        End If
                End Select
            End If
            MainProgram.State = "Open"
            MainProgram.MainFlash.TGotoFrame("ehpbar", 112)
            MainProgram.MainFlash.TPlay("ehpbar")
            MainProgram.MainFlash.TGotoFrame("ehpf", 21)
        Else
            Dim Found2 As Boolean
            'begin mainprogram.Ability
            LoadAbility.ShowAbility("LoadAbility", "n4th4ni3l")
            cmdvar = Replace(LTrim(RTrim(LCase(txt))), "Ability ", "")
            If InStr(MainProgram.AbilityData_List, "|+|" + cmdvar) Then
                Dim tempAbilityint As Integer, AbilityResolved As Boolean = False
                For tempAbilityint = InStr(MainProgram.AbilityData_List, "|+|" + cmdvar) + 3 To Len(MainProgram.AbilityData_List) Step 1
                    If Mid(MainProgram.AbilityData_List, tempAbilityint, 1) = "|" Then
                        Found2 = True
                        LoadAbility.ShowAbility(mainprogram.CapitalizeEachWord(cmdvar), "n4th4ni3l")
                        If MainProgram.AbilityData_InsideBattle = True Then
                            If MainProgram.User_Level >= Val(MainProgram.AbilityData_RequiredLevel) Then
                                If MainProgram.User_Class = MainProgram.AbilityData_RequiredClass Then
                                    If InStr(MainProgram.AbilityData_Cost, "HP") Then
                                        If MainProgram.User_CurHP - Val(Replace(MainProgram.AbilityData_Cost, "HP", "")) < 0 Then
                                            MainProgram.SND("/rYou don't have enough HP to use that mainprogram.Ability.")
                                        Else
                                            MainProgram.User_CurHP -= Val(Replace(MainProgram.AbilityData_Cost, "HP", ""))
                                            MainProgram.UseAbility(MainProgram.AbilityData_VIRID)
                                        End If
                                    ElseIf InStr(MainProgram.AbilityData_Cost, "WP") Then
                                        If MainProgram.User_CurWP - Val(Replace(MainProgram.AbilityData_Cost, "WP", "")) < 0 Then
                                            MainProgram.SND("/rYou don't have enough WP to use that mainprogram.Ability.")
                                        Else
                                            MainProgram.User_CurWP -= Val(Replace(MainProgram.AbilityData_Cost, "WP", ""))
                                            MainProgram.UseAbility(MainProgram.AbilityData_VIRID)
                                        End If
                                    ElseIf InStr(MainProgram.AbilityData_Cost, "SP") Then
                                        If MainProgram.User_CurSP - Val(Replace(MainProgram.AbilityData_Cost, "SP", "")) < 0 Then
                                            MainProgram.SND("/rYou don't have enough SP to use that mainprogram.Ability.")
                                        Else
                                            MainProgram.User_CurSP -= Val(Replace(MainProgram.AbilityData_Cost, "SP", ""))
                                            MainProgram.UseAbility(MainProgram.AbilityData_VIRID)
                                        End If
                                    End If
                                    MainProgram.updatebars()
                                Else
                                    MainProgram.SND("/rYou don't meet the required class to use that mainprogram.Ability.")
                                End If
                            Else
                                MainProgram.SND("/rYou aren't experienced enough to use that mainprogram.Ability.")
                            End If
                        Else
                            MainProgram.SND("/rYou can't use that mainprogram.Ability during battle.")
                        End If
                        If MainProgram.AbilityData_Exhausted = True Then
                            ' cause exhaustion to player
                        End If
                        Exit For
                    End If
                Next
                If Found2 = False Then
                    MainProgram.SND("/RERROR 133")
                    LoadAbility.ShowAbility(mainprogram.CapitalizeEachWord(cmdvar), "n4th4ni3l")
                    MainProgram.SND("/Z[/YAbility Number/Z: /y" + MainProgram.AbilityData_VIRID + "/Z//y" + MainProgram.AbilityData_Total + "/Z]")
                    MainProgram.SND("/yName             : /w" + MainProgram.AbilityData_Name)
                    MainProgram.SND("/yRequired Level   : /w" + MainProgram.AbilityData_RequiredLevel)
                    MainProgram.SND("/yRequired Class   : /w" + MainProgram.AbilityData_RequiredClass)
                    MainProgram.SND("/yConsumes Time    : /w" + MainProgram.AbilityData_Time + " in 1/10s")
                    MainProgram.SND("/yCost             : /w" + MainProgram.AbilityData_Cost)
                    If MainProgram.AbilityData_Exhausted = True Then
                        MainProgram.SND("/yCauses Exhaustion: /wTrue")
                    Else
                        MainProgram.SND("/yCauses Exhaustion: /wFalse")
                    End If
                    If MainProgram.AbilityData_OutsideBattle = True Then
                        MainProgram.SND("/yOutside Battle   : /wTrue")
                    Else
                        MainProgram.SND("/yOutside Battle   : /wFalse")
                    End If
                    If MainProgram.AbilityData_InsideBattle = True Then
                        MainProgram.SND("/yInside Battle    : /wTrue")
                    Else
                        MainProgram.SND("/yInside Battle    : /wFalse")
                    End If
                    MainProgram.SND("/yNumber of Affects: /w" + LTrim(Str(MainProgram.AbilityData_AffectNumber)))
                End If
            End If
            'end mainprogram.Ability
        End If
    End Sub
#End Region
#Region "Shopping MainProgram.State"
    Private Sub ShoppingStateInput(ByVal txt As String, ByVal nputlen As Short)
        Dim cmdvar As String = "" : Dim cmdlen As Short = 0 : Dim exiting As Boolean = False : Dim KeepDataNum(39) As String
        For cmdlen = 1 To Len(txt) Step 1
            If Mid(txt, cmdlen, 1) = " " Then
                cmdvar = Mid(txt, 1, cmdlen - 1)
                cmdlen = Len(cmdvar)
                Exit For
            End If
        Next
        If txt = Mid("list", 1, nputlen) Then
            Dim tmp0 As Integer
            For tmp0 = 0 To 24 Step 1
                If MainProgram.MobData_Mer_ListVNUM(tmp0) <> "" Then
                    MainProgram.SND(MainProgram.FormatVendorItem(MainProgram.MobData_Mer_ListVNUM(tmp0)))
                End If
            Next
        ElseIf txt = Mid("inventory", 1, nputlen) Then
            Dim tmp0 As Integer
            MainProgram.SND("/gYou look within your bags...")
            MainProgram.SND("/W[IIIIIIIIII)Inventory(IIIIIIIIII]")
            For tmp0 = 0 To 39 Step 1
                If MainProgram.User_Inventory(tmp0) <> "" Then
                    MainProgram.SND("/w " + MainProgram.User_Inventory(tmp0))
                End If
            Next
            MainProgram.SND("/W[IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII]")
        ElseIf cmdvar = Mid("sell", 1, cmdlen) And nputlen > cmdlen + 1 Then
            Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
            Dim tmp0 As Integer, Soldit As Boolean = False
            For tmp0 = 0 To 24 Step 1
                If MainProgram.User_Inventory(tmp0) <> "" Then
                    If InStr(LCase(LTrim(MainProgram.User_Inventory(tmp0))), tmpa) Then
                        LoadItem.LoadItem(MainProgram.User_InventoryNUM(tmp0))
                        MainProgram.User_Inventory(tmp0) = ""
                        MainProgram.User_InventoryNUM(tmp0) = ""
                        MainProgram.AddMoney(MainProgram.ItemData_Worth)
                        MainProgram.SND("/gYou sold " + MainProgram.ItemData_SHORT + " for " + MainProgram.ItemData_Worth + "/g.")
                        Soldit = True
                        Exit For
                    End If
                End If
            Next
            If Soldit = False Then
                MainProgram.SND("/gYou don't have that item.")
            End If
        ElseIf cmdvar = Mid("examine", 1, cmdlen) And nputlen > cmdlen + 1 Then
            Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
            Dim tmp0 As Integer, boughtit As Boolean = False, Money As String = ""
            For tmp0 = 0 To 24 Step 1
                If InStr(LCase(MainProgram.MobData_Mer_ListCODE(tmp0)), tmpa) Then
                    LoadItem.LoadItem(MainProgram.MobData_Mer_ListVNUM(tmp0))
                    If MainProgram.ItemData_BasicType = "Miscellaneous" Then
                        MainProgram.SND("/c*/C**********************************************")
                        MainProgram.SND(MainProgram.AddSpace("/c* Base Type:", 23) + "/zMiscellaneous")
                        MainProgram.SND(MainProgram.AddSpace("/c* Name:/z ", 25) + MainProgram.ItemData_ITEMN)
                        MainProgram.SND(MainProgram.AddSpace("/c* Short:/z ", 25) + MainProgram.ItemData_SHORT)
                        MainProgram.SND(MainProgram.AddSpace("/c* Look:/z ", 25) + MainProgram.ItemData_LOOKD)
                        MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z ", 25) + MainProgram.ItemData_Weight)
                        MainProgram.SND(MainProgram.AddSpace("/c* Purchasable Area:/z ", 25) + MainProgram.ItemData_PurchasableAreas)
                        MainProgram.SND(MainProgram.AddSpace("/c* Worth:/z ", 25) + MainProgram.ItemData_Worth)
                        MainProgram.SND("/c***********************************************")
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Sex:/z ", 25) + MainProgram.ItemData_SexRequirement)
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Level:/z ", 25) + MainProgram.ItemData_LevelRequirement)
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Class:/z ", 25) + MainProgram.ItemData_ClassRequirement)
                        MainProgram.SND("/c*/C**********************************************")
                    ElseIf MainProgram.ItemData_BasicType = "Armor" Then
                        MainProgram.SND("/c*/C**********************************************")
                        MainProgram.SND(MainProgram.AddSpace("/c* Base Type:", 23) + "/zArmor")
                        MainProgram.SND(MainProgram.AddSpace("/c* Name:/z ", 25) + MainProgram.ItemData_ITEMN)
                        MainProgram.SND(MainProgram.AddSpace("/c* Look:/z ", 25) + MainProgram.ItemData_LOOKD)
                        MainProgram.SND(MainProgram.AddSpace("/c* Armor Type:/z ", 25) + MainProgram.ItemData_ProfReq)
                        MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z ", 25) + MainProgram.ItemData_Weight)
                        MainProgram.SND(MainProgram.AddSpace("/c* Purchasable Area:/z ", 25) + MainProgram.ItemData_PurchasableAreas)
                        MainProgram.SND(MainProgram.AddSpace("/c* Worth:/z ", 25) + MainProgram.ItemData_Worth)
                        MainProgram.SND("/c***********************************************")
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Sex:/z ", 25) + MainProgram.ItemData_SexRequirement)
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Level:/z ", 25) + MainProgram.ItemData_LevelRequirement)
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Class:/z ", 25) + MainProgram.ItemData_ClassRequirement)
                        MainProgram.SND("/c*/C**********************************************")
                    ElseIf MainProgram.ItemData_BasicType = "Weapon" Then
                        MainProgram.SND("/c*/C**********************************************")
                        MainProgram.SND(MainProgram.AddSpace("/c* Base Type: ", 23) + "/zWeapon")
                        MainProgram.SND(MainProgram.AddSpace("/c* Name:/z ", 25) + MainProgram.ItemData_ITEMN)
                        MainProgram.SND(MainProgram.AddSpace("/c* Look:/z ", 25) + MainProgram.ItemData_LOOKD)
                        MainProgram.SND(MainProgram.AddSpace("/c* Weapon Type:/z ", 25) + MainProgram.ItemData_TYPE)
                        MainProgram.SND(MainProgram.AddSpace("/c* Weight:/z ", 25) + MainProgram.ItemData_Weight)
                        MainProgram.SND(MainProgram.AddSpace("/c* Craftsmanship:/z ", 25) + MainProgram.ItemData_Craftsmanship)
                        MainProgram.SND(MainProgram.AddSpace("/c* Two Handed:/z ", 25) + MainProgram.ItemData_2Handed)
                        MainProgram.SND(MainProgram.AddSpace("/c* mainprogram.Damage Type:/z ", 25) + MainProgram.ItemData_DamageType)
                        MainProgram.SND(MainProgram.AddSpace("/c* Purchasable Area:/z ", 25) + MainProgram.ItemData_PurchasableAreas)
                        MainProgram.SND(MainProgram.AddSpace("/c* Worth:/z ", 25) + MainProgram.ItemData_Worth)
                        MainProgram.SND("/c***********************************************")
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Sex:/z ", 25) + MainProgram.ItemData_SexRequirement)
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Level:/z ", 25) + MainProgram.ItemData_LevelRequirement)
                        MainProgram.SND(MainProgram.AddSpace("/c* Required Class:/z ", 25) + MainProgram.ItemData_ClassRequirement)
                        MainProgram.SND("/c*/C**********************************************")
                        Exit For
                    End If
                End If
            Next
        ElseIf cmdvar = Mid("buy", 1, cmdlen) And nputlen > cmdlen + 1 Then
            Dim tmpa As String = LTrim(RTrim(Mid(txt, cmdlen + 1, Len(txt))))
            Dim tmp0 As Integer, boughtit As Boolean = False, Money As String = ""
            For tmp0 = 0 To 24 Step 1
                If InStr(LCase(MainProgram.MobData_Mer_ListCODE(tmp0)), tmpa) Then
                    LoadItem.LoadItem(MainProgram.MobData_Mer_ListVNUM(tmp0))
                    If MainProgram.CompareMoney(MainProgram.ItemData_Worth) = True Then
                        If MainProgram.User_WeightCarried + Val(LTrim(RTrim(Replace(MainProgram.ItemData_Weight, "Stones", "")))) > MainProgram.User_WeightCarriedMax Then
                            'The player didn't have enough money to buy the item
                            MainProgram.SND("/RYou're not strong enough to carry any more.")
                        Else
                            'the following saves the item number bought so that it's sent to the stable item list that's saved with each
                            'character. Merchant lists are reset daily for random items. Stable items are saved permanately in a different
                            'spot on the character and in the character file since they are random and random items are reset in local
                            'variables with the restarting of the game.
                            AddStableRandomItem(MainProgram.MobData_Mer_ListVNUM(tmp0))
                            'note that nothing is saved as dictated above if the MainProgram.User doesn't have room in their inventory.
                            If MainProgram.User_additem(MainProgram.MobData_Mer_ListVNUM(tmp0)) = 1 Then 'make sure that you have inventory space before attempting to add, or mainprogram.removing item from merchant
                                'test to see if the item is a random item, if it is, then save the variables to the randominventoryitem values
                                If InStr(MainProgram.MobData_Mer_ListVNUM(tmp0), "?") Then
                                    'The following is for stable random items aka: Random items that have been purchased or are currently in use

                                End If
                                'Add the weight of the item bought to current weight carried
                                MainProgram.User_WeightCarried += Val(LTrim(RTrim(Replace(MainProgram.ItemData_Weight, "Stones", ""))))
                                'remove the item currently bought from the merchant list
                                MainProgram.MobData_Mer_ListVNUM(tmp0) = ""
                                MainProgram.MobData_Mer_ListCODE(tmp0) = ""
                                'remove the amount of money the item cost
                                MainProgram.RemoveMoney(MainProgram.ItemData_Worth)
                                'display that the player bought the item and how much it cost, as well as how much money they now currently have
                                MainProgram.SND("/gYou bought " + MainProgram.ItemData_SHORT + "/g for " + MainProgram.ItemData_Worth + "/g. You now have " + MainProgram.User_Sovern + " Sovern, " + MainProgram.User_Dover + " Dover, and " + MainProgram.User_Vern + "Vern.")
                            End If
                        End If
                        boughtit = True
                    Else
                        MainProgram.SND("/gYou can't afford that.")
                        boughtit = True
                    End If
                    Exit For
                End If
            Next
            If boughtit = False Then
                MainProgram.SND("/g" + MainProgram.MobData_MNAME + " isn't selling that.")
            End If
        ElseIf txt = Mid("done", 1, nputlen) Then
            Dim KeepData As String
            MainProgram.SND("/w" + MainProgram.MobData_MNAME + " - /G" + Chr(34) + "/gThanks for the business " + MainProgram.User_Name + "./G" + Chr(34))
            MainProgram.State = "Open"
            exiting = True
            'CustomItemData = ""
            'VIRID#?1(?1)
            'ITEMT#?1(5)
            'ITEMC#?1(00)
            'ITEMN#?1(/WA Fine Bone Longbow)
            'SHORT#?1(A Longbow)
            'LONGD#?1(A Fine Bone Longbow is here.)
            'LOOKD#?1(Bow)
            'EQUIP#?1(Range)
            'PARID#?1(2,00,79,09,45,P,No,R,1d8+1,Y,010,1 Stones,020:030,None,Any)
            'WORTH#?1(62 Vern)
        End If
        If exiting = False Then MainProgram.SND("/c[Options:/G list/c,/G buy itemname/c, /Gexamine itemname/c,/G inventory/c,/G sell itemname/c,/G done/c.] Weight Carried: " + LTrim(Str(MainProgram.User_WeightCarried)) + "\" + LTrim(Str(MainProgram.User_WeightCarriedMax)))
    End Sub
#End Region
#End Region
    'TestEmoteAndAbility is called during open and closed MainProgram.State when the player types a command that isn't registered in
    'the default command list. It opens the emote list and mainprogram.Ability list, recurses through those lists, if the input
    'is within one of those lists then it activates that emote or mainprogram.Ability respectfully.
    Private Sub TestEmoteAndAbility(ByVal txt As String, ByVal nputlen As Short, ByVal cmdlen As Short)
        Dim TempHelpVar = 0, TempEmoteVar As Integer, Found2, Found As Boolean, tmp3 As Integer
        Dim cmdvar As String = ""
        'begin mainprogram.Ability
        LoadAbility.ShowAbility("LoadAbility", "n4th4ni3l")
        cmdvar = Replace(LTrim(RTrim(LCase(txt))), "Ability ", "")
        If InStr(MainProgram.AbilityData_List, "|+|" + cmdvar) And cmdvar <> "ic" Then
            Dim tempAbilityint As Integer, AbilityResolved As Boolean = False
            For tempAbilityint = InStr(MainProgram.AbilityData_List, "|+|" + cmdvar) + 3 To Len(MainProgram.AbilityData_List) Step 1
                If Mid(MainProgram.AbilityData_List, tempAbilityint, 1) = "|" Then
                    Found2 = True
                    LoadAbility.ShowAbility(mainprogram.CapitalizeEachWord(cmdvar), "n4th4ni3l")
                    If MainProgram.AbilityData_InsideBattle = True Then
                        If MainProgram.User_Level >= Val(MainProgram.AbilityData_RequiredLevel) Then
                            If MainProgram.User_Class = MainProgram.AbilityData_RequiredClass Then
                                If InStr(MainProgram.AbilityData_Cost, "HP") Then
                                    If MainProgram.User_CurHP - Val(Replace(MainProgram.AbilityData_Cost, "HP", "")) < 0 Then
                                        MainProgram.SND("/rYou don't have enough HP to use that mainprogram.Ability.")
                                    Else
                                        MainProgram.User_CurHP -= Val(Replace(MainProgram.AbilityData_Cost, "HP", ""))
                                        MainProgram.UseAbility(MainProgram.AbilityData_VIRID)
                                    End If
                                ElseIf InStr(MainProgram.AbilityData_Cost, "WP") Then
                                    If MainProgram.User_CurWP - Val(Replace(MainProgram.AbilityData_Cost, "WP", "")) < 0 Then
                                        MainProgram.SND("/rYou don't have enough WP to use that mainprogram.Ability.")
                                    Else
                                        MainProgram.User_CurWP -= Val(Replace(MainProgram.AbilityData_Cost, "WP", ""))
                                        MainProgram.UseAbility(MainProgram.AbilityData_VIRID)
                                    End If
                                ElseIf InStr(MainProgram.AbilityData_Cost, "SP") Then
                                    If MainProgram.User_CurSP - Val(Replace(MainProgram.AbilityData_Cost, "SP", "")) < 0 Then
                                        MainProgram.SND("/rYou don't have enough SP to use that mainprogram.Ability.")
                                    Else
                                        MainProgram.User_CurSP -= Val(Replace(MainProgram.AbilityData_Cost, "SP", ""))
                                        MainProgram.UseAbility(MainProgram.AbilityData_VIRID)
                                    End If
                                End If
                                MainProgram.updatebars()
                            Else
                                MainProgram.SND("/rYou don't meet the required class to use that mainprogram.Ability.")
                            End If
                        Else
                            MainProgram.SND("/rYou aren't experienced enough to use that mainprogram.Ability.")
                        End If
                    Else
                        MainProgram.SND("/rYou can't use that mainprogram.Ability during battle.")
                    End If
                    If MainProgram.AbilityData_Exhausted = True Then
                        ' cause exhaustion to player
                    End If
                    Exit For
                End If
            Next
            If Found2 = False Then
                MainProgram.SND("/RERROR 133")
                LoadAbility.ShowAbility(mainprogram.CapitalizeEachWord(cmdvar), "n4th4ni3l")
                MainProgram.SND("/Z[/YAbility Number/Z: /y" + MainProgram.AbilityData_VIRID + "/Z//y" + MainProgram.AbilityData_Total + "/Z]")
                MainProgram.SND("/yName             : /w" + MainProgram.AbilityData_Name)
                MainProgram.SND("/yRequired Level   : /w" + MainProgram.AbilityData_RequiredLevel)
                MainProgram.SND("/yRequired Class   : /w" + MainProgram.AbilityData_RequiredClass)
                MainProgram.SND("/yConsumes Time    : /w" + MainProgram.AbilityData_Time + " in 1/10s")
                MainProgram.SND("/yCost             : /w" + MainProgram.AbilityData_Cost)
                If MainProgram.AbilityData_Exhausted = True Then
                    MainProgram.SND("/yCauses Exhaustion: /wTrue")
                Else
                    MainProgram.SND("/yCauses Exhaustion: /wFalse")
                End If
                If MainProgram.AbilityData_OutsideBattle = True Then
                    MainProgram.SND("/yOutside Battle   : /wTrue")
                Else
                    MainProgram.SND("/yOutside Battle   : /wFalse")
                End If
                If MainProgram.AbilityData_InsideBattle = True Then
                    MainProgram.SND("/yInside Battle    : /wTrue")
                Else
                    MainProgram.SND("/yInside Battle    : /wFalse")
                End If
                MainProgram.SND("/yNumber of Affects: /w" + LTrim(Str(MainProgram.AbilityData_AffectNumber)))
            End If
        End If
        If MainProgram.State = "Open" Then
            'end mainprogram.Ability
            txt = Replace(txt, "help ", "")
            If txt = Mid("help", 1, nputlen) Or txt = Mid("commands", 1, nputlen) Or txt = Mid("cmds", 1, nputlen) Then
                LoadHelp.ShowHelp("LoadHelp", "Standard") : MainProgram.HelpData_List = LCase(MainProgram.HelpData_List)
            Else
                'remove help as it's not necessary, then test for a help file
                cmdvar = Replace(LTrim(RTrim(LCase(txt))), "help ", "")
                Dim TryHelpFileNumber As Boolean
                If Val(cmdvar) > 0 Then TryHelpFileNumber = True
                If LoadHelp.ShowHelp(cmdvar, "Standard", TryHelpFileNumber) = True Then Found2 = True
                'test to see if MainProgram.User is requesting an emote list
                If Found2 = False Then
                    If txt = Mid("emotes", 1, nputlen) Then
                        MainProgram.SND("/c*/C**********************************************")
                        MainProgram.SND("/c* /CEmote list             ")
                        MainProgram.SND("/c*/C**********************************************")
                        Dim StillEmote As Integer = 0
                        Dim FoundEmote As Boolean = True
                        Dim tmp0 As Integer, tmp1 As Integer, tmp2 As Integer = 1, line As String = ""
                        While FoundEmote = True
                            StillEmote += 1
                            tmp0 = InStr(MainProgram.EmoteData, "EMOTE#" + LTrim(Str(StillEmote)) + "(")
                            If tmp0 > 0 Then
                                tmp0 += 7 + Len(LTrim(Str(StillEmote)))
                                For tmp1 = tmp0 To Len(MainProgram.EmoteData) Step 1
                                    If Mid(MainProgram.EmoteData, tmp1, 1) = ")" Then
                                        If tmp2 = 1 Then
                                            line = Mid(MainProgram.EmoteData, tmp0, tmp1 - tmp0)
                                            tmp2 += 1
                                        ElseIf tmp2 < 5 Then
                                            line += ", " + Mid(MainProgram.EmoteData, tmp0, tmp1 - tmp0)
                                            tmp2 += 1
                                        End If
                                        If tmp2 = 5 Then
                                            MainProgram.SND("/c* " + line)
                                            tmp2 = 1
                                        End If
                                        Exit For
                                    End If
                                Next
                            Else
                                FoundEmote = False
                            End If
                        End While
                        If tmp2 > 1 Then
                            MainProgram.SND("/c* " + line)
                        End If
                        MainProgram.SND("/c*/C**********************************************")
                        Found2 = True
                    End If
                End If
                If Found2 = False Then
                    If Val(txt) > 0 And Val(txt) <= Val(MainProgram.HelpData_Total) Then
                        LoadHelp.ShowHelp(LTrim(Str(Val(cmdvar) - 1)), "n4th4ni3l", True)
                        MainProgram.SND("/Z[/YHelp file/Z: /y" + MainProgram.HelpData_HelpNum + "/Z//y" + MainProgram.HelpData_Total + "/Z]")
                        If MainProgram.HelpData_Type = "help" Then
                            For tmp3 = 0 To 39 Step 1
                                If MainProgram.HelpData_Line(tmp3) <> "" Then
                                    MainProgram.SND(MainProgram.HelpData_Line(tmp3))
                                Else
                                    Exit For
                                End If
                            Next
                        Else
                            MainProgram.SND("/y" + MainProgram.HelpData_Type)
                            MainProgram.SND("/w" + MainProgram.HelpData_Data)
                        End If
                    End If
                End If
            End If
            LoadEmote.ShowEmote("Smile", "n4th4ni3l", 0) : MainProgram.EmoteData_LIST = LCase(MainProgram.EmoteData_LIST)
            For TempEmoteVar = 1 To Len(txt)
                If Mid(txt, TempEmoteVar, 1) = " " Then
                    cmdvar = Mid(txt, 1, TempEmoteVar - 1)
                    'SND(cmdvar) 'for debugging purposes, MainProgram.clean this up
                    Found = True
                    Exit For
                End If
            Next
            If Found = False Then
                cmdvar = txt
            End If
            If InStr(MainProgram.EmoteData_LIST, "|+|" + cmdvar) Then
                If nputlen > cmdlen + 1 Then 'attempt at targetable emotes

                Else 'regular emote
                    Dim tempemoteint As Integer
                    Dim TheEmote As String = ""
                    For tempemoteint = InStr(MainProgram.EmoteData_LIST, "|+|" + cmdvar) + 3 To Len(MainProgram.EmoteData_LIST) Step 1
                        If Mid(MainProgram.EmoteData_LIST, tempemoteint, 1) = "|" Then
                            Found = True
                            TheEmote = Mid(MainProgram.EmoteData_LIST, InStr(MainProgram.EmoteData_LIST, "|+|" + cmdvar) + 3, tempemoteint - 3 - InStr(MainProgram.EmoteData_LIST, "|+|" + cmdvar))
                            TheEmote = UCase(Mid(TheEmote, 1, 1)) + Mid(TheEmote, 2, Len(TheEmote))
                            LoadEmote.ShowEmote(TheEmote, "", 0)
                            MainProgram.SND("/gYou " + MainProgram.EmoteData_PERSE)
                            Exit For
                        End If
                    Next
                    If Found = False Then
                        TheEmote = Mid(MainProgram.EmoteData_LIST, InStr(MainProgram.EmoteData_LIST, "|+|" + cmdvar) + 3, tempemoteint - 3 - InStr(MainProgram.EmoteData_LIST, "|+|" + cmdvar))
                        TheEmote = UCase(Mid(TheEmote, 1, 1)) + Mid(TheEmote, 2, Len(TheEmote))
                        LoadEmote.ShowEmote(TheEmote, "", 0)
                        MainProgram.SND("/gYou " + MainProgram.EmoteData_PERSE)
                    End If
                End If
            End If
            '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            'END%%%%%%%%%%%%%%%%%%%%%%  E  M  O  T  E  S  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        End If
    End Sub
End Module
